mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-21 20:20:34 +09:00
User specific items
This commit is contained in:
@@ -17,15 +17,16 @@ class Controller extends BaseController
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->user = $this->user();
|
||||
$this->middleware(function ($request, $next) {
|
||||
$this->user = $this->user();
|
||||
//print_r($this->user);
|
||||
return $next($request);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
if (Auth::check()) { // if logged in, set this user
|
||||
return Auth::user();
|
||||
} else { // not logged in, get first user
|
||||
return User::first();
|
||||
}
|
||||
return User::currentUser();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user