]> BookStack Code Mirror - bookstack/blob - app/Http/Middleware/GlobalViewData.php
Update form.blade.php
[bookstack] / app / Http / Middleware / GlobalViewData.php
1 <?php namespace BookStack\Http\Middleware;
2
3 use Closure;
4 use Illuminate\Http\Request;
5
6 /**
7  * Class GlobalViewData
8  * Sets up data that is accessible to any view rendered by the web routes.
9  */
10 class GlobalViewData
11 {
12
13     /**
14      * Handle an incoming request.
15      *
16      * @param Request $request
17      * @param Closure $next
18      * @return mixed
19      */
20     public function handle(Request $request, Closure $next)
21     {
22         view()->share('signedIn', auth()->check());
23         view()->share('currentUser', user());
24
25         return $next($request);
26     }
27 }