Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

trogne's avatar

php artisan migrate class not found

I have a migration file, with "class CreateUsersTable", but php artisan migrate gives me "class not found".

And composer dump-autoload does not help.

I also tried adding a classmap for migration in composer.json :

    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories",
        "database/migrations"
        ],

Does not help either.

File is "2019_10_12_154406_create_users_table.php"

0 likes
10 replies
shez1983's avatar

what do the lumen doc state? I know lumen has some of the laravel functionality stripped off to make it lightweight/faster etc..

also if you have phpstorm or a good editor try fining Migrate classes (or just browsing via vendor/ folder to see if you actually have them).

trogne's avatar

No, php artisan migrate is supposed to work with lumen too.

Full error :

In Migrator.php line 448:

  Class 'CreateUsersTable' not found

Because there it cannot instantiate the class.

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Any chance there is a syntax error in the file? That would make php unable to read the file (eg missing ; )

trogne's avatar

No syntax errors. Even if empty :

vagrant@homestead:~/codecourse/buildpodcastapp$ php artisan migrate
<?php;
class CreateUsersTable
{
}

In Migrator.php line 448:

  Class 'CreateUsersTable' not found
Snapey's avatar

Some issue with case sensitivity?

trogne's avatar

oh... I now have now error starting from the beginning, must be a silly mistake... I'll post back

trogne's avatar

Ok, sorry guys. Stupidest mistake ever. <?php;.

Komodo IDE didn't point that out.

Thanks

Sinnbeck's avatar

Please remember to mark best answer in case others are looking for the same issue 😊

muathye's avatar

Look for class name 2019_10_12_154406_create_users_table.php file to ensure that its name is CreateUsersTable

Please or to participate in this conversation.