environment
Laravel version and support window, PHP requirement, Composer and Node versions, Vite or Mix, Livewire/Inertia/Vue/React, and the database, cache, queue and session drivers.
env.laravel-end-of-life
Open source · MIT · PHP 8.3+
larainspect is a read-only command-line tool. Point it at a Laravel application and get its stack, dependencies, routes, configuration, database schema, security risks, architecture and code quality. It can also ask an AI model to explain what it found.
git clone https://github.com/mrunknown0001/laravel-project-inspector.git
Findings -------- CRITICAL 1. .env is committed to version control HIGH 2. Debug mode is enabled in a production environment HIGH 3. APP_KEY is not set HIGH 5. CORS allows any origin together with credentials HIGH 11. A public route calls phpinfo() HIGH 13. CSRF protection is disabled for all routes HIGH 16. Raw SQL built with request input (potential) MEDIUM 19. Session cookie is readable by JavaScript ... Summary CRITICAL 1 HIGH 16 MEDIUM 16 LOW 7 INFO 1
Every new project starts with the same questions. larainspect inspect answers all of them at once.
composer.lock in sync? Do the locked packages fit the PHP version?dependenciesRun them all with inspect, one at a time with its own command, or pick some with --only.
Laravel version and support window, PHP requirement, Composer and Node versions, Vite or Mix, Livewire/Inertia/Vue/React, and the database, cache, queue and session drivers.
env.laravel-end-of-life
Lock drift, PHP version conflicts, vendor drift, abandoned packages, Packagist security advisories, outdated packages and insecure Composer settings.
deps.security-advisory
Routes rebuilt from bootstrap/app.php or RouteServiceProvider: groups, prefixes, resources, controller groups and controller middleware, each classified by access control.
routes.duplicate
App, session, cache, queue, logging, CORS, filesystem, auth and hashing settings, with where each value came from, plus production misconfiguration.
config.production-sync-queue
Connections and engine, and the tables, foreign keys and indexes defined in migrations. Flags likely missing indexes. It never connects to the database.
db.missing-index
Debug mode, APP_KEY, cookies, CORS, committed secrets, sensitive files, risky routes, CSRF exclusions, injection patterns, mass assignment, unescaped Blade output and more.
sec.csrf-disabled
Controllers, models, services, repositories, jobs, events, Livewire/Filament/Inertia, integrations and authentication packages, plus a plain-English overview.
arch.large-classes
PHPStan/Larastan, Pint/PHP CS Fixer/PHP_CodeSniffer, Rector, tests and CI configuration. Tools can optionally be run in report-only mode.
quality.no-tests
Nothing in your project is executed or included. The inspector reads files and parses them.
Opened read-only. Every path is confined to the project root, and symlinks pointing outside it are refused.
Only harmless .env keys are read. Config files, routes, migrations and classes are parsed with nikic/php-parser, never run.
Facts and findings, each with a severity, a confidence, evidence and a fix.
Removes .env secrets, API tokens, private keys and URL passwords from everything that follows.
Terminal, Markdown, self-contained HTML or JSON, plus optional AI explanations.
composer audit --locked --no-plugins --no-scripts
composer outdated --direct --locked --no-plugins --no-scripts
git -c core.fsmonitor=false ls-files
composer --version · node --version · npm --version
Each runs without a shell, has a timeout, and is recorded in reports/audit.log. Add --offline to skip the two that contact Packagist.
The inspector says how sure it is, and why.
.env..env.example.sec.sql-injection
Why it matters
Request input is concatenated or passed directly into a raw SQL expression, which allows SQL injection.
Evidence
app/Http/Controllers/ReportController.php:14
$rows = DB::select("SELECT * FROM orders WHERE status = '" . $request->input('status') . "'");
Fix
Use query builder methods or bindings: whereRaw("email = ?", [$email]). Never concatenate input into SQL.
Files are read through a reader that has no write methods. Writing reports inside the project is refused, including via .. or a symlink.
It doesn't run artisan, never includes PHP files and never connects to the database. Running artisan or the project's tools needs a flag and your confirmation.
Only harmless .env keys are read. Secret findings show a location and a masked prefix, never the value.
Allowlisted programs only, no shell, timeouts. Composer runs without the project's plugins and scripts.
Each command and AI request is written to the audit log and listed in the report's Operations section.
No telemetry. Packagist sees package names only, and --offline stops even that.
An independent review of the safety-critical code found two real gaps before release. Both were fixed, and each has a regression test.
Off by default. When you ask for it, the model gets the redacted results, never your code.
.env files or any secret value<project> and ~)$ larainspect ai ./app --dry-run # prints the exact prompts, sends nothing $ larainspect ai ./app --provider=anthropic $ larainspect ai --ai-task=documentation --provider=openrouter --model=anthropic/claude-opus-4.5
| Provider | Setting | Default model | Notes |
|---|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | claude-opus-5-5 | Messages API, version 2026-10-21; refusals handled |
| OpenAI | OPENAI_API_KEY | set OPENAI_MODEL | Base URL override works with compatible servers |
| OpenRouter | OPENROUTER_API_KEY | set OPENROUTER_MODEL | Cost reported when available |
| NoTokenLimit | NOTOKENLIMIT_API_KEY | set NOTOKENLIMIT_MODEL | Third-party reseller; adapter based on observed API behaviour |
The first three run by default, one request each. AI output gets its own section, labelled AI-generated. It never adds findings or changes severities.
Colour terminal output. Add -v for evidence and fixes.
Markdown for pull requests, wikis and tickets.
One self-contained file with no external assets. See one.
Stable schema for tooling. report can re-render it later.
- run: |
git clone --depth 1 https://github.com/mrunknown0001/laravel-project-inspector.git inspector
composer install --no-dev --working-dir=inspector
- run: php inspector/bin/larainspect inspect app \
--format=markdown --output=inspection.md --fail-on=high
| 0 | Success |
|---|---|
| 1 | Error: invalid path, not a Laravel app, or an unconfigured AI provider |
| 2 | A finding met the --fail-on threshold |
You need PHP 8.3+ and Composer 2. It lives in its own folder, not inside your project.
$ git clone https://github.com/mrunknown0001/laravel-project-inspector.git ~/tools/laravel-project-inspector $ cd ~/tools/laravel-project-inspector && composer install --no-dev $ ln -s "$PWD/bin/larainspect" ~/.local/bin/larainspect $ cd ~ && larainspect inspect ~/projects/shop
> git clone https://github.com/mrunknown0001/laravel-project-inspector.git C:\Tools\laravel-project-inspector > cd C:\Tools\laravel-project-inspector > composer install --no-dev > bin\larainspect.bat inspect C:\Projects\shop
$ composer global config repositories.larainspect vcs https://github.com/mrunknown0001/laravel-project-inspector.git $ composer global require larainspect/laravel-project-inspector:dev-main $ larainspect inspect ~/projects/shop
Full instructions, including adding it to PATH on Windows and troubleshooting, are in the installation guide.
| Linux, WSL | Developed and used on real projects; CI on PHP 8.3, 8.4, 8.5 |
|---|---|
| macOS | Full test suite passes in CI; not yet tried on real projects |
| Windows | Test suite passes in CI; not yet tried on real projects |
| Laravel | 8 and later; older versions best-effort; Lumen not supported |
--use-artisan.