Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

artisan migrate:rollback throws an error

I have a problem with rollback of a migration. Now going through laravel basics course ( http://teamtreehouse.com/library/laravel-basics/laravel-and-databases/migrations-schema-builder ).

when I run php artisan migrate:rollback

I get the following error:

PHP Fatal error: Class 'CreateTodoListsTable' not found in /Applications/MAMP/htdocs/lopatinkostestapp/laravel/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 301 {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'CreateTodoListsTable' not found","file":"\/Applications\/MAMP\/htdocs\/lopatinkostestapp\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php","line":301}}

Same thing happens for migrate:reset.

1 Answer

Just found a solution. Hope helps someone:)

First I needed to run php composer.phar --working-dir= folder with my laravel framework installed update

Then I ran php composer.phar dump-autoload

And then the php artisan migrate:rollback statement worked.