1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Refactored notification showing and global view data

This commit is contained in:
Dan Brown
2019-09-19 15:12:10 +01:00
parent 60d0f96cd7
commit 2a2cc858f0
15 changed files with 102 additions and 58 deletions

View File

@ -0,0 +1,28 @@
<?php namespace BookStack\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
/**
* Class GlobalViewData
* Sets up data that is accessible to any view rendered by the web routes.
*/
class GlobalViewData
{
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
view()->share('signedIn', auth()->check());
view()->share('currentUser', user());
return $next($request);
}
}