Пример #1
0
 public static function boot()
 {
     parent::boot();
     Article::deleting(function ($article) {
         File::delete($article->document);
     });
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Article::destroy($id);
     return redirect('/admin/articles');
 }
Пример #3
0
 public function articles($id)
 {
     return view('home.courses.articles', ['article' => Article::find($id)]);
 }