newsletters isn't migrated .... run php artisan migrate error won't appear
message: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'app.newsletters' doesn't exist (SQL: select * from `newsletters` order by `newsletters`.`id` desc limit 26 offset 0)"
I have a model Newsletter and a database table "newsletter". Its only to store information about a specific newsletter, and it will only have 1 record.
I created a Laravel Nova Resource for this Newsletter model.
But now when I access the page it shows the error below, because the name of the table is "newsletter" not "newsletters". Also the text of the menu link on the sidebar is "Newsletters" but it should be "Newsletter". Do you know how to solve this issue?
message: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'app.newsletters' doesn't exist (SQL: select * from newsletters order by newsletters.id desc limit 26 offset 0)"
Most likely because you aren't following naming convention. It should be newsletters
But you can hardcore it on the model
protected $table = 'newsletter';
Please or to participate in this conversation.