Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to fix error Base table or view not found

Laravel

Error:

QueryException in Connection.php line 713: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'user.category_posts' doesn't exist (SQL: insert into category_posts (category_id, posts_id) values (4, ))

solution

It seems Laravel is trying to use category_posts table (because of many-to-many relationship). But you don’t have this table, because you’ve created category_post table. Change name of the table to category_posts.

0 0 votes
Article Rating
Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback

[…] How to fix error Base table or view not found […]

trackback

[…] How to fix error Base table or view not found […]

3
0
Would love your thoughts, please comment.x
()
x