Laravel Bigincrements Foreign Key. This isn t really a laravel issue but rather mysql s. When creating a new table in laravel.
After we have set up the migration we will run the migrate command in the terminal to migrate this table to the database. This column will link the posts to the users table. This isn t really a laravel issue but rather mysql s.
As you might have noticed we are also adding a user id column along with the foreign key.
After we have set up the migration we will run the migrate command in the terminal to migrate this table to the database. By the way laravel does have a native function to do this. You most likely forgot to also set the type of your role id foreign key as bigint 20 as well. When creating a new table in laravel.