beginnerLaravel
What is a migration in Laravel?
Answer
Clear, interview-ready explanation
A migration is a version-controlled PHP class that describes a database schema change, such as creating a table, adding a column, creating an index, or changing a foreign key. Migrations provide up and down methods so the change can be applied or reversed.
They let every developer and deployment environment evolve the database in the same order as the application code. Instead of manually altering a shared database, teams commit migrations and run them through Artisan, which records completed migrations in the migrations table.