Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit 29ad237

Browse files
authored
Merge branch 'alexjustesen:main' into main
2 parents 0d866ec + 1c48f74 commit 29ad237

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This is the contents of the published config file:
2727
return [
2828

2929
'resource' => [
30+
'filament-resource' => AlexJustesen\FilamentSpatieLaravelActivitylog\Resources\ActivityResource::class,
3031
'group' => null,
3132
'sort' => null,
3233
],
@@ -36,7 +37,11 @@ return [
3637

3738
## Usage
3839

39-
This package will automatically register the `ActivityResource`. You'll be able to see it when you visit your Filament admin panel.
40+
This package will automatically register the `ActivityResource` class specified in the configuration `resource.filament-resource`. You'll be able to see it when you visit your Filament admin panel.
41+
42+
## Customising the ActivityResource
43+
44+
You can swap out the `ActivityResource` used by publishing the configuration file and updating the `resource.filament-resource` value. Use this to create your own `ActivityResource` class and extend the original at `AlexJustesen\FilamentSpatieLaravelActivitylog\Resources\ActivityResource::class`. This will allow you to customise everything such as the views, table, form and permissions. If you wish to change the resource on List and View page be sure to replace the `getPages` method on the new resource and create your own version of the `ListPage` and `ViewPage` classes to reference the custom `ActivityResource`.
4045

4146
## Customising the group
4247

config/filament-spatie-laravel-activitylog.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
return [
44

55
'resource' => [
6+
'filament-resource' => AlexJustesen\FilamentSpatieLaravelActivitylog\Resources\ActivityResource::class,
67
'group' => null,
78
'sort' => null,
89
],

src/FilamentSpatieLaravelActivitylogServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function configurePackage(Package $package): void
2222
protected function getResources(): array
2323
{
2424
return [
25-
ActivityResource::class,
25+
config('filament-spatie-laravel-activitylog.resource.filament-resource') ?? ActivityResource::class,
2626
];
2727
}
2828

0 commit comments

Comments
 (0)