Laravel Polymorphic Relations: Two “Tricks”

Let’s analyze the source of the Laravel Activity log model that uses polymorphic relations.

– Activity Model source: https://github.com/spatie/laravel-activitylog/blob/5f7e01865b2be12259c4c38a2c48796411ddd0c7/src/Models/Activity.php#L114
– More tutorials on Polymorphic Relations: https://laraveldaily.com/tag/polymorphic-relationships

– – – – –
Support the channel by checking out my products:
– My Laravel courses: https://laraveldaily.com/courses
– Filament examples: https://filamentexamples.com
– Laravel QuickAdminPanel: https://quickadminpanel.com
– Livewire Kit Components: https://livewirekit.com

– – – – –
Other places to follow:
– My weekly Laravel newsletter: https://us11.campaign-archive.com/home/?u=a459401212599a54203d036ee&id=91c1337873
– My personal Twitter: https://twitter.com/povilaskorop

Source: https://www.youtube.com/watch?v=WUCjzi3osU4

Leave a Reply

Your email address will not be published. Required fields are marked *