H
H
HeartOfProgrammer2016-01-04 17:18:05
Laravel
HeartOfProgrammer, 2016-01-04 17:18:05

Why can't rollback laravel 5 migration?

Created a migration with the command:

php artisan make:migration --create=messages create_messages_table

Now I want to roll it back with the following command:
php artisan migrate:reset
There is no rollback, it writes the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
  Fatal error: Class 'CreateMessagesTable' not found

There is a 'CreateMessagesTable' class, but why does it write, won't it find it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2016-01-04
@Denormalization

1) php artisan migrate:reset - does not roll back the migration, but rolls back + rolls again. To ONLY rollback the migration you need to use migrate:rollback
2) This problem is due to composer autoloading, it doesn't pick up the classes correctly. You just need to do composer dumpautoload -o and everything will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question