Migrations are PHP files describing schema changes, created with php artisan make:migration and run with php artisan migrate. The Schema builder provides methods like create(), table(), and column definitions such as string(), integer(), and foreignId(). Rolling back with php artisan migrate:rollback reverses the last batch.
← Laravel theorytheory 0/50 · 0%
Database · easy
13. Migrations
Version-controlled schema changes.
Check your understanding
1. Which command applies pending migrations?
2. What method defines a foreign key column referencing 'users'?