PHP artisan migrate not creating new table

That means Laravel is trying to run the users table migration first. If you are in development and don't need to keep your data, you can just delete the users table and then run php artisan migrate


EDIT

move out already ran migrations from database\migrations folder, before running new migration files. after running the new migrations move back in the past migrations where it was before.

That means you have already ran php artisan migrate once and the table is already present in the database. sometimes you need to do a composer dump-autoload if the artisan is lying.

so you need to either rollback the last change before editing and running php artisan migrate . to rollback you could use php artisan migrate:rollback

Also if you want to remove all changes you could run php artisan migrate:reset .

There is php artisan migrate --force to force run the migration forcefully.

After doing all these steps and if not able to run migration, if its the development environment, drop the database create database again and run the php artisan migrate.


I have been having a similar problem with my Laravel setup (mac os Sierra 10.12.16) and using MAMP with atom and have not found a definitive solution until I followed the next steps.

When setting up up my local environment I have found using the following steps has prevented the migration issues later on,

IN AppServiceProvider.php  add the following code:

use Illuminate\Support\Facades\Schema;

public function boot()
{
    //
    Schema::defaultStringLength(191);
}

then in database.php:

'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

THEN FINALLY IN .env:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=
DB_DATABASE=hackable
DB_USERNAME=root
DB_PASSWORD=root

Hope this helps someone as it took me days to finally get the setup correct :)