user = $this->user(); } 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(); } } }