Laravel Tooling
Priority: P2 (MEDIUM)
Workflow: Set Up Development Tooling
- Install Pint —
composer require laravel/pint --dev; run./vendor/bin/pint. - Configure Vite — Set up
vite.config.jswith Laravel plugin; add@vite()in Blade layout. - Create custom command —
php artisan make:command SendNewsletters. - Add Horizon —
composer require laravel/horizon; configure supervisors.
Custom Artisan Command Example
See implementation examples for Artisan command pattern and project structure.
Implementation Guidelines
Artisan Commands
- Customization: Use
php artisan make:command SendNewsletters. - Definitions: Define
protected $signature = 'newsletters:send {--queue}'. - Execution: Implement
handle(): int. Commands are auto-discovered inapp/Console/Commands/. - Scheduling: Schedule in
bootstrap/app.php(formerly Kernel).
Asset Management (Vite)
- Scaffolding: Run
npm installand configurevite.config.jswith the Laravel plugin. - Blade Integration: Add the @vite directive (
@vite(['resources/css/app.css', 'resources/js/app.js'])) to your layout. - Migration: Use Vite (not Mix) — replace mix() with vite() in Blade templates and remove laravel-mix.
- Workflow: Run
npm run devfor local HMR andnpm run build for production. No manual versioning needed.
Code Quality & Monitoring
- Pint Styling: Enforce standards with
composer require laravel/pint --dev. - Usage: Run
./vendor/bin/pintto apply thepreset: 'laravel'configuration frompint.json. - Queue Observability: Use
composer require laravel/horizon. Runphp artisan horizon:installand configure supervisors inconfig/horizon.php. - Horizon Security: Set authentication gates in
HorizonServiceProvider. Access via/horizonin browser.
Anti-Patterns
- No Laravel Mix: Migrate to Vite for faster HMR.
- No JS in Blade templates: Move scripts to
resources/js. - No manual DB edits: Use Artisan commands or migrations.
- No unstyled commits: Run
./vendor/bin/pintbefore merging.