/ tag
PHP
2 posts on this topic.
-
Polymorphic models in Laravel: one table, two different records (Eloquent morphs)
A CRM tracked two kinds of record that shared almost no fields but flowed through the same statuses, teams, and dashboards. I modeled it as one table with a polymorphic child — and hung the whole framework off the shared root. Mostly it worked; a couple of seams are worth showing.
-
Strangling a legacy database into Laravel (my first big migration, mistakes included)
My first serious Laravel app wasn't greenfield — it had to swallow years of data from a legacy call-center system with tables named `lead` and `hotkey`. Here's the anti-corruption layer and the chunked migration engine I built, and the parts I'd do differently now.