php artisan make:model {name}
This creates an empty model file (i.e: class for data instructions) with a specified name.
php artisan make:controller {name}
This creates an empty controller file in the App>HTTP>Controllers Directory.
php artisan make:migration {name}
Thic creates a table migration instruction file. Use create and table flags if you are adding/changing tables without resetting the migration.
create_name_table
where name is your name.add_colum_to_name_table
where name is your table name and column is your new column name.Command | Description |
---|---|
php artisan migrate |
Create all of the tables specified by the migration instructions in /database/migrations/. |
php artisan migrate:rollback |
Undo the last migration. This is useful for updating the last created table. Simply rollback, make the changes and re-migrate. |
php artisan migrate:reset |
Undo all migrations. This is useful for updating all of the tables. Simply rollback, make the changes and re-migrate. Note that it may be simpler to use refresh for a quicker workflow. |
php artisan migrate:refresh |
Undo all migrations and re-migrate all migrations. This is useful for updating all of the tables at once. Simply make your changes and use this command. |
php artisan migrate:status |
View all migrations and their "migration status" (i.e: if they have migrated or not). |
Command | Description |
---|---|
php artisan tinker |
Start a tinker session. |
php artisan cache:clear |
Clear the page cache for the website. This may be necessary after installing a package. |