Skip to main content

Published

Taking over an existing Laravel application: what to check first

When a previous developer leaves or a project stalls, the temptation is to start fixing bugs right away or propose a rewrite. Both usually create more risk than they solve. Before changing a line of production code in an existing Laravel application, I walk through a fixed set of checks across access, backups, runtime state, security exposure, and deployment.

  • Laravel
  • PHP
  • Codebase takeover
  • Application security
  • Linux
  • Handover

1. Confirm ownership of accounts and code

The first failure mode in a project takeover is not in the code. It is discovering halfway through a release that the domain registrar, DNS, VPS, or Git repository sits under the previous contractor’s personal account.

Before touching anything, verify who controls the Git repository, hosting account, DNS panel, SSL certificates, email delivery (SMTP or SES), and external API keys. Also check whether the code running on the production server actually matches the default branch in Git. When earlier changes were edited directly over SSH, the server often holds unpushed hotfixes.

  • List every account the application depends on: Git, server/VPS, DNS/Cloudflare, object storage, mail, and payment or invoicing providers.
  • Run git status and git diff on the server if the repo lives there, or compare deployed artifacts against the latest tagged commit.
  • Rotate shared SSH keys and stale credentials once you confirm which accounts are still active.

2. Verify database backups before making changes

A scheduled backup script that nobody has ever restored is only a hypothesis. Before running a migration, upgrading PHP or Composer packages, or refactoring a critical flow, take a fresh backup and verify that it restores cleanly into an isolated database.

Check user-uploaded files as well. Many Laravel applications store invoices, attachments, or product photos under storage/app rather than external object storage, and database dumps alone do not protect those files.

3. Map the real runtime environment

Read composer.json, .env.example, and deployment files, then compare them against what is actually running. On an inherited system, documentation is frequently months behind production.

Laravel ships with built-in commands that show the running PHP and framework versions, cache drivers, queue connections, and scheduled tasks without changing application state.

# Inspect framework, PHP, drivers, and cache state (read-only)
php artisan about

# Check known security advisories in installed packages
composer audit

# See scheduled tasks and failed background jobs
php artisan schedule:list
php artisan queue:failed

# Check what is actually listening on public interfaces
ss -tulpn
  • Check whether APP_DEBUG is false and APP_ENV is production in the live .env file.
  • Check PHP and Laravel versions against active security support windows (I have worked on codebases ranging from Laravel 5.8 and 8 up to 11–13, and older versions often carry unsupported dependencies).
  • Inspect cron entries, systemd units, or Supervisor/Horizon configs to confirm queue workers and the scheduler are actually running.

4. Check network exposure and high-impact security gaps

Application code and host setup have to be checked together. A clean Laravel controller does not help if the database port is open to the internet or if Docker published a container port that bypasses UFW.

On the application side, I look first at boundaries that protect user data and money: authentication, authorization checks (Policies and middleware on sensitive routes), mass assignment, file uploads, hardcoded secrets in Git history, and non-atomic writes around orders, balances, or quotas.

  • Verify from an outside network which ports answer on the server IP, not just from localhost.
  • If the site sits behind Cloudflare, verify the origin server cannot be reached directly by IP.
  • Review public routes and admin panels for missing authorization middleware or rate limiting.

5. Reproduce locally before touching production

Never use production as your debugging environment. Getting the application running locally (or on a separate staging copy with anonymized or minimal seed data) is what turns guesswork into repeatable work.

Document every undocumented step needed to boot the app: required PHP extensions, queue workers, Node build steps, environment variables, and external webhooks. That file becomes the first version of the handover documentation.

6. Stabilize first, avoid reflexive rewrites

A full rewrite is rarely the right first step. Rewriting an undocumented system usually recreates old edge cases slowly while freezing business changes for months. In most takeovers, it makes more sense to isolate critical security and reliability issues first, put deployments into a repeatable CI/CD pipeline, and then improve the worst modules incrementally.

Rebuilding only earns its cost when the existing foundation blocks safe fixes altogether — for example, when an unmaintained prototype mixes broken authorization, fragile hosting, and unrecoverable technical debt and the actual scope is small enough to replace cleanly.

What a clean handover looks like

Whether I stay on for ongoing development or hand the project back to an internal team, the goal is that the next engineer never has to repeat this detective work. Every piece of configuration belongs in the client’s Git repository, secrets stay outside Git, deployments run through a documented pipeline, and a short operational guide explains how to deploy, roll back, and restore a backup.

See also: Freelance Laravel backend development, Application and server security, Docker published ports bypass UFW, CI/CD in a small company.