Everything on Eloquent.
5 articles tagged Eloquent, sorted newest first.
Filament v4 Nested Resources: Editing Child Models in Parent Context Without RelationManagers
How to scaffold a Filament v4 nested resource that edits child models inside the parent's URL: with scoped queries, pre-filled foreign keys, and policies that hide forbidden actions.
Filament v4 Many-to-Many Relation Managers: Pivot Fields, Attach, and Detach
How to surface pivot data in a Filament v4 relation manager: withPivot, AttachAction with form fields, scoped record selects, and a safe detach story.
Replacing String Constants with PHP Backed Enums in Laravel Models
String constants like STATUS_PENDING are typo-prone, unautocompleted, and impossible to enumerate exhaustively. PHP backed enums fix all of that: and Laravel has native support throughout.
PHP Readonly Classes as Value Objects in Laravel
Primitive obsession is one of those code smells that's easy to ignore: until you're debugging which integer is pounds and which is pence. PHP readonly classes fix that cleanly.
PHP 8.4 Property Hooks in Laravel Models
PHP 8.4 property hooks are a tidy language-level alternative to getters and setters: but before you reach for them in your Eloquent models, there's a catch worth understanding.