you have to create a table with the name invoices or specify the table with the protected $table = 'invoice'; in your model invoice
Sep 10, 2018
3
Level 1
Base table or view not found: Exception
Hi everyone,
In my application , I have created a model with name 'Invoice' and table with name 'invoice'. I am trying to get all records from invoice table.. my query is
$invoice=Invoice::all();
But , I am getting exception as follows
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lara_relationships.invoices' doesn't exist (SQL: select * from invoices)"
Why it is throwing error with table name invoices ?
where as my table name is only invoice and trying to fetch values using Invoice Model .
Please help me .. Thank you inadvance
Level 3
1 like
Please or to participate in this conversation.