php artisan af-octane:test [--json] [--ci] [--path=app/]
| # | Scanner | What It Checks |
|---|---|---|
| 1 | Singleton Binding | singleton() with request/auth/session data |
| 2 | Static Properties | Static vars holding models, users, requests |
| 3 | Facade Misuse | Auth/Request/Session in constructors |
| 4 | Runtime Config | config([]), Config::set(), putenv() |
| 5 | DB Connections | DB::connection() without disconnect, queries in loops |
| 6 | Unsafe Packages | debugbar, ignition, log-viewer issues |
| 7 | Livewire | Heavy queries in render(), static props, storing models |
| 8 | Blade State | Static vars in @php, $GLOBALS usage |
| 9 | Job State | Static props in jobs, state in handle() |
| 10 | Memory Leaks | Growing static arrays, infinite loops, no cleanup |
| 11 | Cache Misuse | Keys without context, rememberForever, caching requests |
// WRONG
$this->app->singleton(Service::class, fn() => new Service(auth()->user()));
// CORRECT
$this->app->scoped(Service::class, fn() => new Service(auth()->user()));
// WRONG
class Service {
private static $user;
}
// CORRECT
class Service {
private $user;
}
// WRONG
public function __construct() {
$this->user = Auth::user();
}
// CORRECT
public function doAction() {
$user = Auth::user();
}
// WRONG
Cache::remember('data', 60, fn() => User::all());
// CORRECT
Cache::remember('tenant:'.tenant('id').':data', 60, fn() => User::all());
// WRONG
config(['app.name' => 'New Name']);
// CORRECT - Use .env or database instead
Setting::set('app_name', 'New Name');
- name: Octane Safety Check
run: php artisan af-octane:test --ci --json > report.json
Exit code 1 if critical issues found.
{
"summary": {
"execution_time": 0.99,
"files_scanned": 312,
"passed_checks": 2,
"warnings": 3,
"critical_issues": 0
},
"results": {
"scanner_name": {
"vulnerabilities": [...]
}
}
}
scoped() instead of singleton() for request dataShouldQueue for long-running jobsphp artisan octane:status # Check worker health
php artisan octane:cache:warm # Warm cache before deploy
OCTANE_ANALYZER_DOCUMENTATION.mdHow can I help you explore Laravel packages today?