public function getLogout() { if ($this->auth->check()) { Channel::whereUserId($this->auth->id())->delete(); } $this->auth->logout(); return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/'); }
public function viewSession($sessionId) { try { $channel = Channel::findOrFail($sessionId); $avatar = Auth::user()->userProfile->avatar; $hasOwnChannel = \CoreProc\JuanNJuan\Channel::whereUserId(Auth::id())->exists(); return $this->makeView('session', 'Session: ' . $channel->name, ["session_id" => $sessionId, "channel" => $channel, "avatar" => $avatar, "hasOwnChannel" => $hasOwnChannel]); } catch (ModelNotFoundException $e) { app()->abort(404); } }