1

2 months agoby Silence Ronald Kugotsi

SQLSTATE[42S02]: Base table or view not found: 1146 on admin panel

I am getting this error on admin panel using your tutorial Laravel - Create Blog and Admin Panel

(5/5) ErrorException SQLSTATE42S02: Base table or view not found: 1146 Table 'bitfames.admin_role' doesn't exist (SQL: select roles.*, admin_role.admin_id as pivot_admin_id, admin_role.role_id as pivot_role_id from roles inner join admin_role on roles.id = admin_role.role_id where admin_role.admin_id = 1) (View: /Users/skug/Desktop/db/bitfames/resources/views/admin/layouts/sidebar.blade.php) (View: /Users/skug/Desktop/db/bitfames/resources/views/admin/layouts/sidebar.blade.php) (View: /Users/skug/Desktop/db/bitfames/resources/views/admin/layouts/sidebar.blade.php)

1

Silence Ronald Kugotsi replied 2 months ago

0

i have check the database name and correct it, i have admin_roles not admin_role so how can i solve the problem

(5/5) ErrorException SQLSTATE42S02: Base table or view not found: 1146 Table 'bitfumes.admin_role' doesn't exist (SQL: select roles.*, admin_role.admin_id as pivot_admin_id, admin_role.role_id as pivot_role_id from roles inner join admin_role on roles.id = admin_role.role_id where admin_role.admin_id = 1) (View: /Users/skug/Desktop/db/bitfumes/resources/views/admin/layouts/sidebar.blade.php) (View: /Users/skug/Desktop/db/bitfumes/resources/views/admin/layouts/sidebar.blade.php) (View: /Users/skug/Desktop/db/bitfumes/resources/views/admin/layouts/sidebar.blade.php)

91

Sarthak Shrivastava replied 2 months ago

0

Hey, this can happen because of many reasons. But the first one I can see is, I think you are using database named 'bitfumes' and you have misspell it

bitfames.admin_role should be bitfumes.admin_role

Also, please check other things like

  1. Have you migrated the tables,
  2. Do you have migration of admin_role table
  3. if you have then check the spelling again.
  4. also make sure you have correct relationship
Ask Question
Most Visited
Categories