#No User name and how to add user role in table?
4 messages · Page 1 of 1 (latest)
is the causer id stored?
if so, is there a field 'name' on the users table? by defauylt it does causer.name you see.
Thanks sir... our user model was modified so I updated this
{
return TextColumn::make('causer.full_name')
->label(__('activitylog::tables.columns.causer.label'))
->getStateUsing(function (Model $record) {
if ($record->causer_id == null) {
return new HtmlString('—');
}
return $record->causer->full_name ?: new HtmlString('—');
})
->searchable(query: function ($query, $search) {
$query->whereHas('causer', function ($q) use ($search) {
$q->where('first_name', 'like', "%{$search}%")
->orWhere('last_name', 'like', "%{$search}%")
->orWhere('middle_name', 'like', "%{$search}%");
});
});
}```
and it's ok now
However on the UserResource side no track of data on that user
ActivityLogTimelineTableAction::make('Activities')
->timelineIcons([
'created' => 'heroicon-m-check-badge',
'updated' => 'heroicon-m-pencil-square',
])
->timelineIconColors([
'created' => 'info',
'updated' => 'warning',
])
->limit(10),```