Ejemplo n.º 1
0
 public function getLogout()
 {
     if ($this->auth->check()) {
         Channel::whereUserId($this->auth->id())->delete();
     }
     $this->auth->logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function remove($id)
 {
     try {
         $channel = Channel::findOrFail($id);
         $channel->delete();
     } catch (Exception $e) {
         return Error::response($e);
     }
     return Response::json(['ok' => ['message' => 'Channel has been successfully deleted']]);
 }
 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);
     }
 }