Answer the question
In order to leave comments, you need to log in
How to exclude records with a certain status from all selections in laravel?
Good afternoon.
Is it somehow possible to define a method in the model that would work for all selections on the entire project, so that records with a certain status are excluded everywhere?
There are a lot of pages in the project and most of them have a selection of the form:
Now there are new records with the status "xxx". How to isolate them from all samples? I don't want to manually add where('status', '!=', 'xxx'). Surely there is a method that applies to all selections.. Thank you.
Model::latest()->paginate(50);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question