Skip to content

Commit

Permalink
change to find first user with public front
Browse files Browse the repository at this point in the history
  • Loading branch information
KodeStar committed Oct 21, 2018
1 parent 7b9d3f0 commit 50d6dc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public static function currentUser()
if ($current_user) { // if logged in, set this user
return $current_user;
} else { // not logged in, get first user
$user = User::first();
$user = User::where('public_front',true)->first();
if(!$user) {
$user = User::first();
}
session(['current_user' => $user]);
return $user;
}
Expand Down

0 comments on commit 50d6dc7

Please sign in to comment.