25 lines
501 B
PHP
25 lines
501 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Middleware;
|
||
|
|
||
|
use App\Models\Setting;
|
||
|
use Closure;
|
||
|
use Illuminate\Support\Facades\Auth;
|
||
|
|
||
|
class View
|
||
|
{
|
||
|
/**
|
||
|
* Handle an incoming request.
|
||
|
*
|
||
|
* @param \Illuminate\Http\Request $request
|
||
|
* @param \Closure $next
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function handle($request, Closure $next)
|
||
|
{
|
||
|
view()->share('user', Auth::user());
|
||
|
view()->share('settingsArray', Setting::getSettingsAsArray());
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|