December 2017
Beginner to intermediate
376 pages
7h 53m
English
Now that we've set up our new migration, let's run it with this Artisan command:
$ php artisan migrate
You should see an output like this in the Terminal:
Migrating: 2017_06_20_133317_create_listings_table Migrated: 2017_06_20_133317_create_listings_table
To confirm the migration worked, let's use Tinker to show the new table structure. If you've never used Tinker, it's a REPL tool that allows you to interact with a Laravel app on the command line. When you enter a command into Tinker it will be evaluated as if it were a line in your app code.
Firstly, open the Tinker shell:
$ php artisan tinker
Now enter a PHP statement for evaluation. Let's use the DB facade's select method to run an SQL DESCRIBE query to show the table structure: ...
Read now
Unlock full access