mirror of
https://github.com/vitodeploy/vito.git
synced 2025-06-30 13:36:15 +00:00
fix default project of admin (#419)
This commit is contained in:
@ -18,9 +18,11 @@ public function handle(Request $request, Closure $next)
|
|||||||
|
|
||||||
if (! $user->currentProject) {
|
if (! $user->currentProject) {
|
||||||
if ($user->allProjects()->count() > 0) {
|
if ($user->allProjects()->count() > 0) {
|
||||||
$user->current_project_id = $user->projects->first()->id;
|
$user->current_project_id = $user->allProjects()->first()->id;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
|
$request->user()->refresh();
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user