Laravel Tip 💡
Loading a large SQL dump in a seeder?
If your Laravel version supports DB::getSchemaState()->load(), use it instead of loading the entire file with file_get_contents().
On older projects, DB::unprepared(file_get_contents(...)) is still a practical fallback.
Newer Laravel: getSchemaState()->load()
Older Laravel: unprepared()
Laravel Tip 💡
Need to know what changed on an Eloquent model?
Before saving, use isDirty() and isClean().
After saving, use wasChanged().
And when you need the previous value, getOriginal() has you covered.
The important part is knowing when to use each one. 👀
Laravel Tip 💡
Using ShouldBeUnique jobs?
Laravel 13.25 adds UniqueJobSkipped, so you can react when Laravel skips a duplicate unique job.
uniqueId() tells Laravel which jobs are duplicates, and the event lets you log or handle the skipped job.
Useful when you want to know which work was skipped.
⚡ As of Laravel 13.21, you can use the "#[RouteKey]" attribute to define the field which should be used when resolving models in routes (instead of using the "getRouteKeyName" method)!
🤯 Pídele a CLAUDE o CODEX que te de toda la ARQUITECTURA de tu app en una sola página HTML y un archivo JSON.
Tu código ahora se explica solo:
El HTML te permite visualizarlo.
El JSON es para que otro agente lo entienda.
Te dejo el prompt que usé abajo 👇