-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override Activitylog resource #5
Comments
You my look the class Activity extends Activitylog
{
//...
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make('Description'),
Text::make('Subject Id'),
Text::make('Subject Type'),
Text::make('Causer', 'causer_id')->displayUsing(function ($user_id) {
return \App\User::find($user_id)->name;
}),
Text::make('Causer Ip', 'properties->ip')->onlyOnIndex(),
Code::make('properties')->json(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE),
DateTime::make('created_at'),
];
}
//...
?> |
Got it! :-) I tried just to "rebind" a resource with the inherited, with the same name via Laravel DI instead of getting a new name and override it within config... |
I'm having a similar problem but I think I'm missing something:
|
Sorry, for some reason Nova wasn't registering the new resource. For other folk, adding:
to |
Hi! Thanks a lot for this nova package!
Could you please help me to override your Activitylog resource? Trying within NovaServiceProvider or my custom service provider - no success...
I would override fields method to output user name instead of id, but can't find the way. Maybe you could help...
Thanks!
The text was updated successfully, but these errors were encountered: