4 years ago

Activity feed tutorial way to eager-load relationship by type

Posted 4 years ago by saqueib

I followed @JeffreyWay tutorial for activity feed

Everything works, but I wanted to eager load some relations, so I did this


which is giving me all thing mixed with Post, Comment all in one result. I wanted to loaded only Post or Comment. like


How could we do it. should i use where clause to limit the activity by App\Post, or there any other way

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