Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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
Sql :: postgres isnull 
Sql :: is not null sql 
Sql :: Create table if not exist with exceptions 
Sql :: sequelize postgresql schema 
Sql :: postgresql functions 
Sql :: sql where statement 
Sql :: order by in sql 
Sql :: if mysql UPDATE 
Sql :: on delete set default 
Sql :: TITLE: SQL Server principal "dbo" does not exist 
Sql :: how to use 3 fields as primary key in sql tables? 
Sql :: Which SQL statement would you use to remove a view called EMP_DEPT_VU from your schema? 
Sql :: t-sql cheat sheet 
Sql :: how to order result of subquery in select 
Sql :: db connection using sql client in dot net 
Sql :: alter domain sql 
Sql :: homebrew nysql launch 
Sql :: get the previous column of a table in mysql 
Sql :: sql multiple column 
Sql :: sql server bool select 
Sql :: mssql get running queries by spid 
Sql :: Search In the Data using ObjectName 
Sql :: amount of entries in a table psql 
Sql :: dynamic pivot 
Sql :: mysql get last character of string 
Sql :: how to add column with custom sequence in postgresql 
Sql :: kill thread 
Sql :: supabase change timezozne 
Sql :: creating a joined view in mysql 
Sql :: cursor.execute (sql, value) ValueError: operation parameter must be str 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =