Quick Start
This is the fastest path from zero to a working console in a Laravel 12 or 13 application.
1. Install the package
bash
composer require ashraftalha/laravel-opconsoleLaravel's package auto-discovery registers AshrafTalha\OpConsole\OpConsoleServiceProvider automatically.
2. Publish the config
bash
php artisan vendor:publish --tag=opconsole-configOptional, but recommended so you can see every option in config/opconsole.php.
3. Create the audit table
bash
php artisan migrate4. Open the console
Sign in to your app, then visit:
text
https://your-app.test/admin/opconsoleWith APP_ENV=local, it works immediately. In every other environment, access is denied until you define the Gates in the next step.
5. Allow access in production
In app/Providers/AppServiceProvider.php, inside boot():
php
use Illuminate\Support\Facades\Gate;
Gate::define('viewOpConsole', fn ($user) => $user->email === 'you@example.com');
Gate::define('runOpConsoleActions', fn ($user) => $user->email === 'you@example.com');See Authentication & Authorization for per-action Gates and a least-privilege production policy.
6. Start the scheduler and a queue worker
The heartbeat checks need both running to report anything other than unknown:
bash
* * * * * cd /path/to/app && php artisan schedule:run >> /dev/null 2>&1bash
php artisan queue:workThat's it
You now have:
- A health dashboard at
/admin/opconsole - An audit trail of every operation you run from it
php artisan opconsole:healthfor CLI / CI health checks
Where to go from here
- Walk through what each tab does: Health Dashboard
- Lock down production access further: Permissions & Security Policies
- Wire up uptime monitoring: Health Checks & Health Score
- See every configuration key: Configuration Reference