alfasix / alfakit-ops
An operations toolkit for AlfaKit panels: failed jobs, queues and batches, the scheduler, a log viewer, cache and maintenance mode, and system information.
Requires
- php: ^8.4
- alfasix/alfakit: ^0.2|@dev
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
by Alfa Six
This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.
An operations toolkit for AlfaKit panels: failed jobs (search, filters, a redacted payload viewer, retry, forget, flush), queues and job batches, the scheduler (frequencies in words, next run in the panel's timezone, last run, "Run now"), a log viewer that pages huge files from the end, cache and maintenance mode tasks, and system information. It renders in React, Vue and Svelte with AlfaKit's built-in components and needs no other Composer package.
Installation
composer require alfasix/alfakit-ops
Register
use AlfaSix\AlfakitOps\OpsPlugin; $panel->plugin( OpsPlugin::make() ->authorize(fn (User $user): bool => $user->is_admin) ->navigationGroup('System'), );
Deny by default: without authorize(), only users the viewAlfakitOps gate allows can see the pages.
Gate::define('viewAlfakitOps', fn (User $user): bool => $user->is_admin);
Options
OpsPlugin::make() ->authorizeActions(fn (string $ability, User $user): bool => $ability !== OpsPlugin::ABILITY_MAINTENANCE_MODE || $user->is_owner) ->readOnly(fn (): bool => app()->isProduction()) ->requiresPasswordConfirmation() ->failedJobs()->queues()->batches()->scheduler()->logs()->maintenance(false) ->redactKeys(['iban']) ->monitorQueues(['redis' => ['default', 'emails']]) ->runScheduledTasksOnQueue(queue: 'ops') ->logDirectory(storage_path('logs')) ->dashboardWidget() ->allowOnTenantPanels();
See the documentation for every option, the abilities and the security notes.
Testing
vendor/bin/pest --test-directory=packages/plugins packages/plugins/ops
License
MIT. See LICENSE.md.