How to associate Activity model with other model e.g TrackInfo #974
Replies: 1 comment
-
laravel-activitylog/config/activitylog.php Lines 33 to 38 in a23de07 https://laravel.com/docs/8.x/eloquent-relationships https://laravel.com/docs/8.x/eloquent#events |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm thinking of a solution to save information of user e.g ip_address, browser, device_name etc whenever Activity Log is being saved. I'm thinking of making another table called track_infos where I'll have foreign id of activity_log_id. But I'm not sure How to define relationship between Activity model and TrackInfo Model.
all I want is to achieve:
Activity::with('track_infos')->get();
Looking forward to hear.
Beta Was this translation helpful? Give feedback.
All reactions