public static function boot() { parent::boot(); News::deleting(function ($newsItem) { File::delete($newsItem->image); }); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { News::destroy($id); return redirect('/admin/news'); }
public function newsItem($id) { return view('home.news.newsItem', ['newsItem' => News::find($id)]); }