morphTo magic

Posted 3 years ago by francois

Hello,

On a laracasts lesson, @JeffreyWay build an activity feed.

On this file https://github.com/laracasts/Build-An-Activity-Feed-in-Laravel/blob/master/app/Activity.php there is a morphTo relation.

What I'm wondering is : What determine the correct model (Class) when in this file https://github.com/laracasts/Build-An-Activity-Feed-in-Laravel/blob/master/resources/views/activity/types/created_post.blade.php he use $event->subject->title ?

Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.