Never mind, $task->activity works out of the box (doh!) and $task->comments->activity can't work since its activity for multiple comments... I'd have to fetch a collection myself, but the more I think about it, it wouldn't make sense to try and show activity fo all comments under a specific task...
Fetching activitylog for a specific model instance (using spatie/laravel-activitylog)
I'm new to Laravel so a little confused by this...
I'm using the https://github.com/spatie/laravel-activitylog package to log model events to the database and that's working fine. So if I create a task and then add comments to it, and the activitylog for both is saved correctly to the database. (Here a 'Comment' has a polymorphic relationship with a 'Task'.)
However, I'd now like to retrieve all recent activity for a task and its comments - the example in the documentation is useful but pretty basic in that it shows a store and immediate retrieval of the very last entry. How do I get recent activity for a specific task i.e. $task->activity and $task->comments->activity ?
Please or to participate in this conversation.