Esempio n. 1
0
 public function rules()
 {
     if (isOnPages()) {
         unset($this->rules['image']);
     }
     return $this->rules;
 }
Esempio n. 2
0
 /**
  * Init
  */
 public function init()
 {
     if (isOnPages()) {
         $this->article = $this->article->onlyPage();
     } else {
         $this->article = $this->article->onlyPost();
     }
 }
 /**
  * Remove the specified article from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     try {
         $this->repository->delete($id);
         return $this->redirect(isOnPages() ? 'pages.index' : 'articles.index');
     } catch (ModelNotFoundException $e) {
         return $this->redirectNotFound();
     }
 }