User specific items

This commit is contained in:
Kode
2018-10-14 17:27:28 +01:00
parent 46bb073001
commit c3da17befc
15 changed files with 367 additions and 18 deletions

View File

@@ -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();
}
}