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

throttlestudio's avatar

Migrate Rollback using --path

I'm trying to rollback a migration that I inserted using the --path parameter.

When trying to rollback I get

[ErrorException]                                          
  Undefined index: 2016_08_24_200946_create_contacts_table

I've included the path in my composer.json file under the autoload classmap setting. The folder exists under the database directory already.

Any help would be appreciated.

FYI using 5.3.1

0 likes
3 replies
stains44's avatar

I have the same problem on fresh install. Did you have any luck yet?

Revolution's avatar

had undefined index problem as above. composer dump-autload, deleting migrations table, restarting vagrant, lots of other attempts all failed. passing path variable worked.

simple solution: on php artisan migrate:rollback --path=/database/migrations/folder

pass the path parameter to the rollback method. that's the solution if composer dump-autoload doesn't work for you on rollback or reset due to undefined index error.

Please or to participate in this conversation.