In this tutorial, we will make a table or Orders, with filtering and ordering.

First, let's start by creating a Model with Migration...
In this tutorial, we will make a table or Orders, with filtering and ordering.

First, let's start by creating a Model with Migration...
I have been experimenting with two aspects of this tutorial, and I Have created a need for something outside the scope but I still want to learn how to do it! We select can select multiple items, and then delete them. I would like to pass an array of names of each item to sweet alert, so that the user can stop the delete if they see something in the displayed list of what is about to be deleted in case they realize that is wrong. I tried a couple of things for this, I was able to adjust the code for a single delete, and pass the name of individual item to sweet alert. I think I need to build an array of these selected names, and pass them to the alert. does this logic exist elsewhere? does this make sense as a feature / concept?
Hello, I have a question for this function:
why in this function we loop over the orders then delete them instead of deleting them directly like this:
As I know that deleting them directly has better performance right? Correct me if I'm wrong please.
Thanks.
Because for each of the deleted object, the OBSERVERS would get fired, or other Eloquent events in the future. If we just mass-delete them, yes it's faster but it wouldn't trigger the observers.
@Povillas Koropisn't there a way to trigger the needed observer events manually iterating over the$ordersbefore mass-deleting them, to avoid N+1 queries for deleting the orders?