-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Unable to add BREAD to table #5843
Comments
Change the database table to "tests". You want to make your table names plural in most cases. |
I've created(also renamed) several times the table with name Tests(plural form) but all I got was the same error when browsing Bread:
|
I've figured out what the issue was as follows:
|
Hello, Tables needs names in all small letters and plural. Not Test, not Tests, not test Kind regards |
manually create model for Test (model name) ** better to reallocate model directly inside app folder App add below codes on Test Model `
` |
Laravel version
9.52.16
PHP version
8.3.3-1+0
20240216.17+debian101.gbp87e37bVoyager version
1.7
Database
MariaDB version 10.3.39
Description
I'm trying to create a simple project but got stuck on the first step as follows.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.tests' doesn't exist (SQL: select
Test.* from
testsorder by
created_atdesc) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.tests' doesn't exist (SQL: select
Test.* from
testsorder by
created_atdesc) at /home/project/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)
As I undestand the table name is created as singular but the browse BREAD is looking for the plural name of the table!
Steps to reproduce
I'm trying to create a simple project but got stuck on the first step as follows.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.tests' doesn't exist (SQL: select
Test.* from
testsorder by
created_atdesc) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.tests' doesn't exist (SQL: select
Test.* from
testsorder by
created_atdesc) at /home/project/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)
Expected behavior
Browse the BREAD
Screenshots
Additional context
No response
The text was updated successfully, but these errors were encountered: