From 62e857e448ac5af1ff3e4b8b835d5e8754863c8b Mon Sep 17 00:00:00 2001 From: Alf Drollinger Date: Wed, 30 Aug 2023 00:52:01 +0200 Subject: [PATCH] Update README.md --- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 137bf08..20f28a8 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,94 @@ Work in progress. Should become a Filament panel for managing job queues includi ## Installation -You should install the package via Composer: +Install the package via Composer: ```bash composer require adrolli/filament-job-manager php artisan vendor:publish --tag=filament-job-manager ``` -### Authorization +Create the necessary tables, if not using Redis as backend for queues: + +```bash +php artisan queue:table +php artisan queue:failed-table +php artisan queue:batches-table +php artisan migrate +``` + +You can publish the config file with: + +``` +php artisan vendor:publish --tag="filament-jobs-monitor-config" +``` + + + +This is the content of the published config file: + +``` + [ + 'jobs' => [ + 'enabled' => true, + 'label' => 'Job', + 'plural_label' => 'Jobs', + 'navigation_group' => 'Job manager', + 'navigation_icon' => 'heroicon-o-cpu-chip', + 'navigation_sort' => 1, + 'navigation_count_badge' => false, + 'resource' => Adrolli\FilamentJobManager\Resources\JobsResource::class, + ], + 'failed_jobs' => [ + 'enabled' => true, + 'label' => 'Failed Job', + 'plural_label' => 'Failed Jobs', + 'navigation_group' => 'Job manager', + 'navigation_icon' => 'heroicon-o-exclamation-circle', + 'navigation_sort' => 2, + 'navigation_count_badge' => false, + 'resource' => Adrolli\FilamentJobManager\Resources\FailedJobsResource::class, + ], + 'job_batches' => [ + 'enabled' => true, + 'label' => 'Job Batch', + 'plural_label' => 'Job Batches', + 'navigation_group' => 'Job manager', + 'navigation_icon' => 'heroicon-o-inbox-stack', + 'navigation_sort' => 3, + 'navigation_count_badge' => false, + 'resource' => Adrolli\FilamentJobManager\Resources\JobBatchesResource::class, + ], + ], + 'pruning' => [ + 'enabled' => true, + 'retention_days' => 7, + ], +]; + +``` + + + +You can publish and run the migrations with: + +``` +php artisan vendor:publish --tag="filament-jobs-monitor-migrations" +php artisan migrate +``` + + + +## Usage + +Just run a Background Job and go to the route `/admin/queue-monitors` to see the jobs. + + + +### Authorization - outdated! Use Shield instead! If you would like to prevent certain users from accessing your page, you should register a policy: