I am deploying a Laravel barebone project to Microsoft Azure, but whenever I try to execute php artisan migrate
I get the error:
[2015-06-13
I think it's late to answer this question but maybe this will help someone.
If you changed the migration file name, be sure about its inner class name.
For example, If I change a migration name from 2018_06_10_079999_create_admins_table.php
to 2018_06_10_079999_create_managers_table.php
so its inner class name must change from CreateAdminsTable
to CreateManagerTable
too.
simply delete the row at your database on table migrations
and that will fix the problem. It will not show anymore when you do migrations
other way is to simple create the file it depends of what u want, in my case I wanted to get rid of this migration. :)
Just make sure the following two files contain the correct class name and migration name :
C:\xampp\htdocs\StuffSpot\vendor\composer\autoload_classmap.php C:\xampp\htdocs\StuffSpot\vendor\composer\autoload_static.php
For PSR-4 Auto Loader Users (composer.json):
Keep the migrations folder inside classmap
array and do not include it inside psr-4 object under autoload
head. As migrations' main class Migrator doesn't support namespacing. For example;
"autoload": {
"classmap": [
"app/database/migrations"
],
"psr-4": {
"Acme\\controllers\\": "app/controllers"
}
}
Then run:
php artisan clear-compiled
php artisan optimize:clear
composer dump-autoload
php artisan optimize
From this time on wards, you will not have to do this again and any new migrations will work correctly.
I had foolishly put:
namespace database\migrations;
Inside my migration create_users_table.php [2014_10_12_000000_create_users_table.php]
I was getting a similar error - Class 'CreateUsersTable' not found.
Removing this line at the top solved this error.
If you get the "Class not found error" when running migrations, please try running this command.
composer dump-autoload
then re-issuing the migrate command. See more details in the offical site (#Running Migrations): http://laravel.com/docs/master/migrations#running-migrations