Work down the list against your production setup. A check you cannot tick is a lead worth following, not a verdict.

Security

  1. APP_DEBUG is off, and debugging tools are restricted. Debug pages and tools such as Telescope can expose queries, stack traces and configuration to anyone who finds them.
  2. Only public/ is served, so /.env cannot be downloaded. A web root set to the project folder hands out your credentials and application key.
  3. Secrets stay out of the repository. Anyone who can read the code, including past contractors, can read committed keys, so rotate any that were.
  4. Each record is protected by a policy or gate, not just a login. Without one, changing an ID in the URL can show another user's data.
  5. Models set $fillable deliberately, and controllers use validated() data. Open mass assignment lets a user set fields such as is_admin by adding them to a request.
  6. Every input is validated on the server, including file uploads. An unchecked upload can carry a script, so check type and size and keep uploads off the public web root.
  7. Raw SQL uses bindings, and {!! !!} prints trusted HTML only. Unescaped input in queries or templates is how SQL injection and cross-site scripting happen.
  8. CSRF protection is on, and its exclusions are limited to webhooks. Without it another site can submit forms for a logged-in user, and webhooks should verify a signature instead.
  9. Login, password reset and contact forms are rate-limited. Unlimited attempts make password guessing and form spam cheap for attackers.
  10. HTTPS is enforced, and session cookies are marked secure. Without both, sessions can be intercepted on shared networks.

Performance

  1. Config, routes and views are cached on every deploy. config:cache, route:cache and view:cache save the framework from repeating that work on every request.
  2. Lists eager-load related records with with(). One query per row is a common cause of slow pages, and Model::preventLazyLoading() flags it during development.
  3. Columns used to filter, join and sort are indexed. Missing indexes go unnoticed while tables are small, then slow every query as they grow.
  4. Large result sets are paginated or chunked. Loading a whole table with get() can exhaust memory, while chunkById() and lazy() read it in pieces.
  5. Emails, PDFs, imports and API calls run on queues. A visitor should not wait for work that can finish in the background.
  6. Repeated expensive reads are cached in a store every server shares. A shared store such as Redis keeps repeated calculations off the database.

Code health

  1. env() is called only inside config/ files. Once config is cached, env() elsewhere stops reading .env, so values silently go missing.
  2. Automated tests cover the paths that make money or hold data. Tests let you change and upgrade the app without discovering breakage in front of customers.
  3. Laravel Pint and a static analyser such as Larastan run automatically. They catch whole classes of mistakes and keep style consistent between developers.
  4. An empty database can be built from migrations alone. Schema changes made by hand in production make staging, tests and recovery unreliable.
  5. The README and .env.example are enough to run the app locally. If setup knowledge sits with one person, the app is at risk when they leave.

Dependencies and upgrades

  1. PHP is a version that still gets security fixes. Unsupported versions receive no patches, and the supported versions list shows which are current.
  2. Laravel is a version that still gets security fixes. The release notes give each version's support window, so upgrades can be planned, not rushed.
  3. composer audit and npm audit run on a schedule. They list installed packages with known security advisories, so you hear about them first.
  4. composer.lock is committed, and production installs with --no-dev. Production then runs the versions you tested, without test tools on the server.

Operations

  1. Backups run automatically, and a restore has been tested. An untested backup is a guess, and a copy kept on the same server fails with it.
  2. Errors reach a person, and logs cannot fill the disk. Without error tracking you hear about failures from customers, and the daily log channel rotates files.
  3. Queue workers run under a supervisor and restart on deploy. Workers keep old code in memory until php artisan queue:restart, and failed jobs need someone watching queue:failed.
  4. One cron entry runs schedule:run every minute. Without it no scheduled task runs, so add withoutOverlapping() to long tasks and onOneServer() on several servers.
  5. Deploys are scripted and can be rolled back. A script runs migrate --force, builds caches and restarts workers the same way every time, while hand copying drifts.

Want us to run this on your app?

The Laravel Health Check reviews the code, security and performance of an existing Laravel application for a fixed fee of $750–$1,500, and generates a documentation site for it. If you would rather have the application looked after, care plans start at $300 a month. Every price is on the pricing page.