w0bm.com v1.5z FULL.RETARD.BUILD.BUT.STILL.WORKS
This commit is contained in:
32
app/Http/Middleware/Theme.php
Normal file
32
app/Http/Middleware/Theme.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
class Theme
|
||||
{
|
||||
protected $auth;
|
||||
protected $view;
|
||||
|
||||
public function __construct(Guard $auth, Factory $view)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->view = $view;
|
||||
}
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$paths = $this->view->getFinder()->getPaths();
|
||||
foreach ($paths as &$p) {
|
||||
$p .= "/layout" . (auth()->check() ? auth()->user()->layout : 1);
|
||||
}
|
||||
$this->view->setFinder(new \Illuminate\View\FileViewFinder($this->view->getFinder()->getFilesystem(), $paths));
|
||||
return $next($request);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user