For example, if an article is to be deleted, only the creator of this article can delete it. How should the following destroy()
method be added?
public function destroy($id)
{
$user = \Auth::user();
//...
Article::destroy($id);
//...
}
Pseudo code:
The relatively correct approach is,
1. Don’t let him have the opportunity to press the delete button (hidden on the interface)
2. Judge before deleting