11 Laravel Tips in 8 Minutes: December 2024
HTML-код
- Опубликовано: 7 янв 2025
- A monthly tradition of the most valuable tweets for that month.
Support the channel by checking out my products:
My Laravel courses: laraveldaily.c...
Filament examples: filamentexampl...
Livewire Kit Components: livewirekit.com
Other places to follow:
My weekly Laravel newsletter: us11.campaign-...
My personal Twitter: / povilaskorop
The missing translation function is very helpful!
Regarding the "complex queries in controllers": why would you make a separate class for a single query as opposed to adding a method to the relevant model?
Good question. Maybe because Model is too big already?
Also, I guess if you are going to have plenty of those instances then it'd make sense - just to keep everything tidier. As in the example, some applications might have a lot of reports/statistics that might need long, complicated queries just to get the total amount or count or something similar
I have a table in my db has expires_at filed how do I make the system delete the record that has expired I tried observer and command schedule and it didn't work and caused a bug I am using laravel 11
use the prunable trait, configure the method to check the expires_at column and add model:prune command to your scheduler at whatever interval you want
@@NorthernWinter Thanks man , that helps !
where and how to start my laravell journey
I have a roadmap for Laravel: laraveldaily.com/roadmap-learning-path
@LaravelDaily thank you