Пример #1
0
 /**
  * @return void|Text
  */
 protected function getModel()
 {
     try {
         return Text::findByCurrentSlug();
     } catch (ModelNotFoundException $error) {
     }
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  string $slug
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($slug)
 {
     $text = Text::findBySlug($slug);
     /** @var Model $model */
     $model = $text->text;
     $model->destroy($model->id);
     $text->destroy($text->slug);
     return $this->redirectToIndex();
 }