Home > database >  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'iop.servicecategories' doesn�
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'iop.servicecategories' doesn�

Time:05-09

i have a problem with this error so there are my table and modelenter image description here

enter image description here

i try to put this in my model: protected $table = 'servicecategories';

but the problem is not solved. also try to clear cache and delete table but the problem is not solved, also if i try to make a simple php artisan

CodePudding user response:

In your migration you are using a common class, but Laravel uses anonymous classes. On class CreateServicecategoriesTable extends Migration { you should replace with return new class extends Migration {.

CodePudding user response:

Please run command => php artisan migrate

CodePudding user response:

In db ..Your table name is different from your class name. I think they both should be the same I think this is the problem .. When you run php artisan migrate works?

  • Related