TickYouOff
Back
🐘

Migrating a PHP App to Laravel

Hard 18 items · 2 hours
testuser's avatar
testuser Published 1 month ago

A practical migration checklist for developers moving a legacy PHP application to Laravel. It guides teams through auditing, scaffolding, routing, Eloquent mapping, service extraction, Blade conversion, auth, queues, and test porting.

Progress
0 / 18
  1. Audit codebase and dependencies — List PHP version, libraries, custom frameworks, and deprecated code.
  2. Export database schema and constraints — Dump schema, FK relations, and indexes for model mapping.
  3. Create new Laravel project scaffold
  4. Install required Composer packages — Add auth, queue, and DB drivers needed for your app.
  5. Configure environment (.env) and app settings — Set DB, cache, queue, mail, and APP_KEY values.
  6. Set up version control and branch strategy — Create a migration branch and define CI hooks and reviews.
  7. Map legacy routes to Laravel routes — List endpoints, HTTP verbs, and middleware equivalents.
  8. Create controllers and map actions — Group related endpoints into controllers and actions.
  9. Extract business logic into service classes — Move domain logic out of controllers into reusable services.
  10. Create Eloquent models and relationships — Define models, casts, fillable, relationships, and accessors.
  11. Write database migrations and seeders — Translate schema to Laravel migrations and create seeders.
  12. Run data migration scripts and verify integrity — Migrate production data and validate row counts and FK integrity.
  13. Convert PHP views to Blade templates and update assets — Replace includes, echo syntax, and update asset paths.
  14. Implement authentication and authorization with Laravel — Use Breeze/Jetstream or guards and map roles/permissions.
  15. Migrate queues, jobs, and scheduled tasks — Map cron jobs to scheduler and legacy jobs to Laravel jobs/queues.
  16. Port tests to Laravel's PHPUnit TestCase — Convert or rewrite unit and feature tests to Laravel format.
  17. Configure CI/CD and deployment for Laravel — Update build, run migrations, and set env handling in deployment.
  18. Run end-to-end QA, performance tests, and create rollback plan — Smoke test endpoints, load test, and document rollback steps.
Sign in to save
📝 My Notes