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

rickyspires's avatar

Can't get migration to work ?

Hello. When i run php artisan migration it only adds CreateUsersTable and CreatePasswordResetsTable . all my other migrations dont get added ?

I get the error: [Symfony\Component\Debug\Exception\FatalErrorException]
Cannot redeclare class CreateArticlesTable

but i haven't migrated them yet ?

I created them by doing

vagrant@homestead:~/Code/rickyspires-laravel$ php artisan make:migration articles_table
Created Migration: 2015_06_22_222912_articles_table

vagrant@homestead:~/Code/rickyspires-laravel$ php artisan make:migration        add_excerpt_to_articles_table
Created Migration: 2015_06_22_222925_add_excerpt_to_articles_table

vagrant@homestead:~/Code/rickyspires-laravel$ php artisan make:migration    create_tags_table
Created Migration: 2015_06_22_222936_create_tags_table

Then i run $ php artisan migrate and get that error: [Symfony\Component\Debug\Exception\FatalErrorException]
Cannot redeclare class CreateArticlesTable

any ideas ?

0 likes
8 replies
Mo7sin's avatar

Can you check and provide what's in you database/migrations directory?

EliasSoares's avatar

The error is self container, just read-it:

Cannot redeclare class CreateArticlesTable

You have two classes named CreateArticlesTable declares. Rename it and try again!

1 like
madandhakal's avatar

you might have made something mistake in migration file... check it clearly

rickyspires's avatar

I started over and now it seems to work. must have been something in my syntax. thanks all :)

1 like
jwmurray's avatar

I ran into this when I renamed a class inside the migration file without renaming the migration file.

To fix it, I just renamed the migration file.

stackprogramer's avatar

i had same error ,problem is i runed this command "php artisan make:migration create_tasks_table --create=tasks" two times,so i had two files 2016_03_23_051905_create_tasks_table.php and other with other id i delete two file and run command again now:"php artisan migrate" now it works nice.......

Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrated: 2016_03_23_051905_create_tasks_table
Jonjie's avatar

I know this is a late answer, but probably this would solve your issue.

  1. Go to app/storage/migrations.
  2. Delete the migration file that causes the error (You can also delete everything stored there).
  3. Done.
Nakov's avatar

@jonjie what helps even more is deleting the app folder completely 😁

You have an interesting project if your migrations appear under app/storage.

1 like

Please or to participate in this conversation.