Home > Back-end >  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel9rentalcars.categories'
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel9rentalcars.categories'

Time:05-21

this what laravel give me when iam execute my laravel "code" what can i do ? enter image description here

CodePudding user response:

Debug:

  1. Your Table exist or not
  2. If Table not exists then Run migration php artisan migrate
  3. Check you have selected right DB

Share more information like screenshot and what you have tried.., etc

CodePudding user response:

First, check DB_DATABASE in your .env file or database.php in the config folder for the right DB name. if it is ok, then check whether the categories table exists in the databases directory or not (even check the spelling). if it is not, you may create the table by running this command:

php artisan make:migration create_categories_table --create=categories

and then

php artisan migrate

CodePudding user response:

check categories table , if exist then check actual query.

  • Related