Anu smitha
Anu smitha

Reputation: 23

migrate:refresh and migrate:reset gives Class '' not found error in laravel 5.1

I used the command "php artisan migrate:reset" and "php artisan migrate:refresh" both gives the error

[Symfony\Component\Debug\Exception\FatalErrorException]
Class '' not found

I also need to remove column from table using migration in laravel 5.1, please guide me or send me any reference links. I attached my error screen here .

Thanks

Upvotes: 1

Views: 945

Answers (1)

craig_h
craig_h

Reputation: 32694

When I get an issue like this I usually dump the autoloader:

composer dump-autoload

To remove a column from the database you can either remove it from you migration and run:

php artisan migrate:refresh

Which is usually fine in a development environment, but you will lose any data in your database, so it's a good idea to set up some seeders if you want to do it this way.

Otherwise, you can create a new migration to simply drop your column using:

php artisan make:migration drop_my_column_from_my_table --table=my_table

You would then do something like:

Schema::table('my_table', function ($table) {
    $table->dropColumn('my_column');
});

and run you migration as normal:

php artisan migrate

Upvotes: 2

Related Questions