David CarrforDC Blogdcblogdev.hashnode.net·Nov 5, 2022Laravel use multiple boot in traitsLet's say you want to use multiple traits in your models to reuse common code such as applying UUIDs and settings global query scopes like this: use HasUuid; use HasTenant; Each of these traits has a boot method: HasUuid: trait HasUuid { public f...Discuss·69 readstraits
David Carrdcblogdev.hashnode.net·Nov 5, 2022Laravel use multiple boot in traitsLet's say you want to use multiple traits in your models to reuse common code such as applying UUIDs and settings global query scopes like this: use HasUuid; use HasTenant; Each of these traits has a boot method: HasUuid: trait HasUuid { public f...Discuss·69 readstraits