I want to delete a row from table. The function I used in controller is:
public function destroy($id)
{
$post = Post::find($id);
$post->delete();
Session::flash('success', 'The post was just trashed.');
return redirect()->back();
}
However it throws me an error:
Call to a member function delete() on null
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire