public function getLogout() { if (Auth::check()) { Session::delete(Config::get('session.name')); } return Redirect::to('/'); }
/** * Save the model to the database. * Overriden the parent so that customization can be added * * @param array $options * @return bool */ public function save(array $options = []) { // Auto populate creator if ($this->__isset('creator_pk_id') && !$this->creator_pk_id && \Auth::user()) { $this->setAttribute('creator_pk_id', \Auth::user()->id); } return parent::save($options); }
public function __construct() { parent::__construct(); if (Auth::petugas() == null) { header("Location: " . base . "/Auth"); } else { $this->petugas = Auth::petugas(); } }
function index() { $terbaru = Book::orderBy('BookID', 'desc')->skip(0)->take(6)->get(); $data['categories'] = $this->categories; $data['terbaru'] = $terbaru; if (Auth::member() != null) { $data['member'] = Auth::member(); } $this->view->render('home', $data); $this->view->data = "asu"; }
/** * Save the model to the database. * Overriden the parent so that customization can be added * * @param array $options * @return bool */ public function save(array $options = []) { // Auto populate modified at if ($this->__isset('updated_at') && !$this->__isset('created_at')) { $this->setAttribute('updated_at', new \DateTime()); } if ($this->__isset('updated_by') && \Auth::user()) { $this->setAttribute('modified_by', \Auth::user()->id); } return parent::save($options); }
public function detail($book) { $book = Book::find($book); $data['book'] = $book; $data['categories'] = Category::all(); if (Auth::member() != null) { $data['member'] = Auth::member(); } $this->view->render('member/detail', $data); }