Search
 
SCRIPT & CODE EXAMPLE
 

PHP

SQLSTATE[42S02]: Base table or view not found: 1146 Table many to many in laravel

seem i got the solution without change table name
  if u have bookmarks table name
    public function products() {
      return $this->belongsToMany(Product::class, 'bookmarks');
 }
Comment

SQLSTATE[42S02]: Base table or view not found: 1146 Tabl

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.
Comment

SQLSTATE[42S02]: Base table or view not found: 1146 Table many to many in laravel

Ur answer absolutly right Famous Frog, but for case like favorites table or whithlisttable has many to many, how to solve those?
Comment

PREVIOUS NEXT
Code Example
Php :: php mysql text mark question 
Php :: how to put cloth on 3d model using javascript and php 
Php :: rename matomo php 
Php :: short isset and not empty php 8 
Php :: php tools for visual studio package did not load correctly 
Php :: PHP redirect parent page 
Php :: data types of laravel migrations 
Php :: parameterize constructor mpdf php 
Php :: php is multiple of 
Php :: php ffi get load average 
Php :: When you click on the search button, it is moved to the page laravel 
Php :: filter from taggable laravel 
Php :: google api for language translation in php 
Php :: enable gutenberg for template 
Php :: require_once in class php 
Php :: Right triangle start pattern of star 
Php :: laravel 8 remove public from url 
Php :: send email to no register user in laravel 
Php :: controller run 
Php :: app/View/Errors/missing_controller.ctp 
Php :: Ajouter un texte par défaut sur toutes vos publications WordPress 
Php :: php check bracket correct open and close 
Php :: model all 
Php :: php over serial arduino 
Php :: php undefined array key 
Php :: cors laravel 
Php :: fprintf (PHP 5, PHP 7, PHP 8) fprintf — Write a formatted string to a stream 
Php :: getting key from env returns null laravel 
Php :: testimonial custom post type and uses shortcode 
Php :: laravel mix build as umd 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =