#395

So in your database/migrations folder my guess is that your migrations files is arranged like this:

create_questions_table.php
create_subjects_table.php

When you run php artisan migrate

You questions migration file will look for the foreign key subject_id but it does not exist yet because it will still be created after your questions table

Just interchange the sequence of your file in database/migrations folder like this

create_subjects_table.php
create_questions_table.php

How you can delete create_questions_table.php file and then create that file again in the command prompt
php artisan make:table create_questions_table and it will position below create_subjects_table.php