From 50d6dc7b715d962fe3c2c760aa790b6a2b7c3e45 Mon Sep 17 00:00:00 2001 From: Kode Date: Sun, 21 Oct 2018 13:47:03 +0100 Subject: [PATCH] change to find first user with public front --- app/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/User.php b/app/User.php index d74928ac9..e4a68e9c1 100644 --- a/app/User.php +++ b/app/User.php @@ -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; }