Laravel 5.3 migration create relationship table

How to create a migration create relationship table in Laravel 5.3
Run CMD

This creates the relationship migrations file:

create_user_roles_table

This is the migration script for the relationship table.

To build database tables run:

 to build database tables run
Your DB should look like this:

php-artisan-migraterollback

And to revert simple run:

Done.

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

One thought on “Laravel 5.3 migration create relationship table

  1. Thanks. But I think you make a mistake there: “To build database run: php artisan migrate:rollback” (this is to delete the tables in DB). Maybe you mean php artisan migrate. PS: You look like Pastor Cash Luna xD (joke)

Leave a Reply

Your email address will not be published. Required fields are marked *