-
Uff, I've been bit by a quirky Eloquent issue. The worse part is that I know why it happens but I don't know how to "fix it" (I've found a workaround, but Id like to prevent it from happening in the future, ideally with a patch upstream).
It involves relationships, macros for the Builder and eloquent silently overriding an `id` column because the results from the SQL query contain 2 different `id` columns (because of a join).
I'll try to create a sample project with minimum code to reproduce and see if I can manage a fix.
-
Hoy los reyes han dejado esto y ahora vivo con miedo que Trump nos secuestre por la noche 🙈
-
When adding the type for the Query Builder that's passed as an argument to an Eloquent's scope, do you use `Illuminate\Database\Eloquent\Builder` or `Illuminate\Contracts\Database\Eloquent\Builder`.
I just realized they were being used interchangeably on a project I've been working on.
My initial thought would be to use always the contract (the interface is implemented by `Eloquent\Builder` and by `Eloquent/Relations/Relation`), but looking at the docs, the official stance is to import the Builder object 🤔
https://laravel.com/docs/12.x/eloquent#local-scopes
Any thoughts?
-
-
-
My first #fediverseBot is finally live! @[email protected] posts news from the 🇺🇾 newspaper @[email protected] directly from their RSS feed. As bots go, it's really simple but the reason I'm so happy is that's running from my own implementation of an #ActivityPub compatible server made with #Laravel and #PHP. There's still plenty of work to do, but for now, the basics are there and I wanted to test it in the wild.