skip to Main Content

I’m beginner in laravel; I’m trying to create an API of devices. When I try the API, it says there is no such table named devices. Any help would be appreciated.

enter image description here

enter image description here

enter image description here

enter image description here

2

Answers


  1. Please check the .env file and make sure that you se the database connection in a correct way.

    First check the DB_CONNECTION in your case it must be mysql. then check other database connection variables value such as below

    DB_CONNECTION=mysql
    DB_HOST=Here write your database host such as "localhost" or 127.0.0.1
    DB_PORT=Here write the database port default value for mysql is 3306
    DB_DATABASE=Here write the database name in your case write "blog"
    DB_USERNAME=Here write the database username default is "root"
    DB_PASSWORD=Here write the database password or leave it empty if there is no password.
    

    Make sure to write all values without " or ‘ or spaces.

    Login or Signup to reply.
  2. You are using SQLITE in yout .env, try change to: DB_CONNECTION=mysql and check others enviroment from you make a correct connection

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search