feat: add jacobtims/filament-logger

This commit is contained in:
idevakk
2025-09-28 20:36:33 +05:30
parent 6d081e5ad6
commit 10ea8f3cb1
31 changed files with 992 additions and 75 deletions

52
config/activitylog.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
return [
/*
* If set to false, no activities will be saved to the database.
*/
'enabled' => env('ACTIVITY_LOGGER_ENABLED', true),
/*
* When the clean-command is executed, all recording activities older than
* the number of days specified here will be deleted.
*/
'delete_records_older_than_days' => 365,
/*
* If no log name is passed to the activity() helper
* we use this default log name.
*/
'default_log_name' => 'default',
/*
* You can specify an auth driver here that gets user models.
* If this is null we'll use the current Laravel auth driver.
*/
'default_auth_driver' => null,
/*
* If set to true, the subject returns soft deleted models.
*/
'subject_returns_soft_deleted_models' => false,
/*
* This model will be used to log activity.
* It should implement the Spatie\Activitylog\Contracts\Activity interface
* and extend Illuminate\Database\Eloquent\Model.
*/
'activity_model' => \Spatie\Activitylog\Models\Activity::class,
/*
* This is the name of the table that will be created by the migration and
* used by the Activity model shipped with this package.
*/
'table_name' => env('ACTIVITY_LOGGER_TABLE_NAME', 'activity_log'),
/*
* This is the database connection that will be used by the migration and
* the Activity model shipped with this package. In case it's not set
* Laravel's database.default will be used instead.
*/
'database_connection' => env('ACTIVITY_LOGGER_DB_CONNECTION'),
];

View File

@@ -0,0 +1,54 @@
<?php
return [
'datetime_format' => 'd/m/Y H:i:s',
'date_format' => 'd/m/Y',
'activity_resource' => \Jacobtims\FilamentLogger\Resources\ActivityResource::class,
'scoped_to_tenant' => true,
'navigation_sort' => null,
'resources' => [
'enabled' => true,
'log_name' => 'Resource',
'logger' => \Jacobtims\FilamentLogger\Loggers\ResourceLogger::class,
'color' => 'success',
'exclude' => [
// App\Filament\Resources\UserResource::class,
],
'cluster' => null,
'navigation_group' => 'Settings',
],
'access' => [
'enabled' => true,
'logger' => \Jacobtims\FilamentLogger\Loggers\AccessLogger::class,
'color' => 'danger',
'log_name' => 'Access',
],
'notifications' => [
'enabled' => true,
'logger' => \Jacobtims\FilamentLogger\Loggers\NotificationLogger::class,
'color' => null,
'log_name' => 'Notification',
],
'models' => [
'enabled' => true,
'log_name' => 'Model',
'color' => 'warning',
'logger' => \Jacobtims\FilamentLogger\Loggers\ModelLogger::class,
'register' => [
// App\Models\User::class,
],
],
'custom' => [
// [
// 'log_name' => 'Custom',
// 'color' => 'primary',
// ]
],
];