Skip to content

Commit

Permalink
Support localisation (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtawil authored Jan 19, 2021
1 parent fc3b455 commit 6dd9ba3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/Resources/Activitylog.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ public static function label()
return __('Activity Logs');
}

/**
* Get the displayable singular label of the resource.
*
* @return string
*/
public static function singularLabel()
{
return __('Activity Log');
}

/**
* Get a fresh instance of the model represented by the resource.
*
Expand All @@ -82,14 +92,14 @@ public function fields(Request $request)
return [
ID::make()->sortable(),

Text::make('Description'),
Text::make('Subject Id'),
Text::make('Subject Type'),
MorphTo::make('Causer'),
Text::make('Causer Ip', 'properties->ip')->onlyOnIndex(),
Text::make(__('Description'), 'description'),
Text::make(__('Subject Id'), 'subject_id'),
Text::make(__('Subject Type'), 'subject_type'),
MorphTo::make(__('Causer'), 'causer'),
Text::make(__('Causer Ip'), 'properties->ip')->onlyOnIndex(),

Code::make('Properties')->json(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE),
DateTime::make('Created At'),
Code::make(__('Properties'), 'properties')->json(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE),
DateTime::make(__('Created At'), 'created_at'),
];
}

Expand Down

0 comments on commit 6dd9ba3

Please sign in to comment.