By default, the LogsActivity trait uses default_log_name from the config file to write the logs. You can set a different log for each model by overriding the getLogNameToUse() function in your model.
public function getLogNameToUse(string $eventName = ''): string
{
return 'custom_log_name_for_this_model';
}
The Activity model is just a regular Eloquent model that you know and love:
Activity::where('log_name' , 'other-log')->get(); //returns all activity from the 'other-log'
There's also an inLog scope you can use:
Activity::inLog('other-log')->get();
//you can pass multiple log names to the scopeActivity::inLog('default', 'other-log')->get();
//passing an array is just as goodActivity::inLog(['default', 'other-log'])->get();