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'); }
public function articles($id) { return view('home.courses.articles', ['article' => Article::find($id)]); }