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:
28
app/Http/Middleware/GlobalViewData.php
Normal file
28
app/Http/Middleware/GlobalViewData.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user