feat: add Filament packages for enhanced admin functionality

- Add backstage/filament-mails for mail management interface
  - Add binarybuilds/filament-failed-jobs for failed job monitoring
  - Add gboquizosanchez/filament-log-viewer for application log viewing
  - Add jacobtims/filament-logger for enhanced logging capabilities
  - Extend Filament admin panel with comprehensive monitoring tools
  - Improve developer experience with better visibility into system operations
This commit is contained in:
idevakk
2025-11-17 06:33:07 -08:00
parent e330c4f90e
commit bbbaf3a234
55 changed files with 2598 additions and 67 deletions

View File

@@ -0,0 +1,119 @@
<?php
declare(strict_types=1);
return [
/* -----------------------------------------------------------------
| Driver
| -----------------------------------------------------------------
| Available drivers: 'daily', 'stack', 'raw'
| -----------------------------------------------------------------
*/
'driver' => env('FILAMENT_LOG_VIEWER_DRIVER', env('LOG_CHANNEL', 'stack')),
/* -----------------------------------------------------------------
| Resource configuration
| -----------------------------------------------------------------
*/
'resource' => [
'slug' => 'logs',
'cluster' => null,
],
/* -----------------------------------------------------------------
| Logs files can be cleared
| -----------------------------------------------------------------
*/
'clearable' => env('FILAMENT_LOG_VIEWER_CLEARABLE', false),
/* -----------------------------------------------------------------
| Log files storage path
| -----------------------------------------------------------------
*/
'storage_path' => storage_path('logs'),
/* -----------------------------------------------------------------
| Log files pattern
| -----------------------------------------------------------------
*/
'pattern' => [
'prefix' => 'laravel-',
'date' => '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]',
'extension' => '.log'
],
/* -----------------------------------------------------------------
| Log entries per page
| -----------------------------------------------------------------
| This defines how many logs and entries are displayed per page.
*/
'per-page' => [
5,
10,
25,
30,
],
/* -----------------------------------------------------------------
| Download settings
| -----------------------------------------------------------------
*/
'download' => [
'prefix' => 'laravel-',
'extension' => 'log',
],
/* -----------------------------------------------------------------
| Icons
| -----------------------------------------------------------------
*/
'icons' => [
'all' => 'fas-list', // http://fontawesome.io/icon/list/
'emergency' => 'fas-bug', // http://fontawesome.io/icon/bug/
'alert' => 'fas-bullhorn', // http://fontawesome.io/icon/bullhorn/
'critical' => 'fas-heartbeat', // http://fontawesome.io/icon/heartbeat/
'error' => 'fas-times-circle', // http://fontawesome.io/icon/times-circle/
'warning' => 'fas-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
'notice' => 'fas-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/
'info' => 'fas-info-circle', // http://fontawesome.io/icon/info-circle/
'debug' => 'fas-life-ring', // http://fontawesome.io/icon/life-ring/
],
/* -----------------------------------------------------------------
| Colors
| -----------------------------------------------------------------
*/
'colors' => [
'levels' => [
'all' => '#8A8A8A',
'emergency' => '#B71C1C',
'alert' => '#D32F2F',
'critical' => '#F44336',
'error' => '#FF5722',
'warning' => '#FF9100',
'notice' => '#4CAF50',
'info' => '#1976D2',
'debug' => '#90CAF9',
],
],
/* -----------------------------------------------------------------
| Strings to highlight in stack trace
| -----------------------------------------------------------------
*/
'highlight' => [
'^#\d+', '^Stack trace:',
],
];

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',
// ]
],
];

18
config/filament-mails.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
use Backstage\FilamentMails\Resources\EventResource;
use Backstage\FilamentMails\Resources\MailResource;
use Backstage\FilamentMails\Resources\SuppressionResource;
return [
'resources' => [
'mail' => MailResource::class,
'event' => EventResource::class,
'suppression' => SuppressionResource::class,
],
'navigation' => [
'group' => null,
'sort' => null,
],
];

141
config/mails.php Normal file
View File

@@ -0,0 +1,141 @@
<?php
use Backstage\Mails\Models\Mail;
use Backstage\Mails\Models\MailAttachment;
use Backstage\Mails\Models\MailEvent;
return [
// Eloquent model to use for sent emails
'models' => [
'mail' => Mail::class,
'event' => MailEvent::class,
'attachment' => MailAttachment::class,
],
// Table names for saving sent emails and polymorphic relations to database
'database' => [
'tables' => [
'mails' => 'mails',
'attachments' => 'mail_attachments',
'events' => 'mail_events',
'polymorph' => 'mailables',
],
'pruning' => [
'enabled' => true,
'after' => 30, // days
],
],
'headers' => [
'uuid' => 'X-Mails-UUID',
'associate' => 'X-Mails-Associated-Models',
],
'webhooks' => [
'routes' => [
'prefix' => 'webhooks/mails',
],
'queue' => env('MAILS_QUEUE_WEBHOOKS', false),
],
// Logging mails
'logging' => [
// Enable logging of all sent mails to database
'enabled' => env('MAILS_LOGGING_ENABLED', true),
// Specify attributes to log in database
'attributes' => [
'subject',
'from',
'to',
'reply_to',
'cc',
'bcc',
'html',
'text',
],
// Encrypt all attributes saved to database
'encrypted' => env('MAILS_ENCRYPTED', true),
// Track following events using webhooks from email provider
'tracking' => [
'bounces' => true,
'clicks' => true,
'complaints' => true,
'deliveries' => true,
'opens' => true,
'unsubscribes' => true,
],
// Enable saving mail attachments to disk
'attachments' => [
'enabled' => env('MAILS_LOGGING_ATTACHMENTS_ENABLED', true),
'disk' => env('FILESYSTEM_DISK', 'local'),
'root' => 'mails/attachments',
],
],
// Notifications for important mail events
'notifications' => [
'mail' => [
'to' => ['test@example.com'],
],
'discord' => [
// 'to' => ['1234567890'],
],
'slack' => [
// 'to' => ['https://hooks.slack.com/services/...'],
],
'telegram' => [
// 'to' => ['1234567890'],
],
],
'events' => [
'soft_bounced' => [
'notify' => ['mail'],
],
'hard_bounced' => [
'notify' => ['mail'],
],
'bouncerate' => [
'notify' => [],
'retain' => 30, // days
'treshold' => 1, // %
],
'deliveryrate' => [
'treshold' => 99,
],
'complained' => [
//
],
'unsent' => [
//
],
],
];