Check if Record Deleted Laravel ORM
Sometimes when you are working with Laravel you want to check if a record has been deleted and display a success message, so how we can do that?
Check if the record has been deleted
All you need to that is to test the method delete if deleted it will return true else it will return false.
public function destroy($id)
{
$post = Post::findOrFail($id);
if($post->delete()){
return true;
}else{
return false;
}
}