BREAD error
Hi there,
You will need to change the Model from App\SocialMedia
to App\Models\SocialMedia
.
Let me know how it goes!
Hi there,
No, you can do that via Voyager:
- Go to the Voyager Admin
- Click on BREAD
- Click Edit for the BREAD that you want to edit
- Under the
Model Name
change the mode accordingly.
Did you already create the SocialMedia model?
When you add a new Table, you have to add a model as well by clicking the button next to the 'Create model for this table' field:
For more information you can check out the docs here:
https://voyager-docs.devdojo.com/core-concepts/database-manager
Let me know how it goes.
I see, yes make sure that it is enabled so that you could have your model automatically created. Let me know how it goes.
Now I have another issue. when I click to browse, I get the following error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zgtumqgvhw.social_media' doesn't exist
select `Social_Media`.* from `social_media` order by `created_at` desc
Am i meant to always run php artisan migrate when I create a new table or is there something wrong on the server?
Hi there,
With Voyager you don't have to run php artisan migrate.
The problem is that you are not following the Laravel naming convention.
Your table name should be social_medias with an s
at the end, otherwise, Laravel will fail to find the table.
All models should be singular, eg. User, Post, Comment, but the tables should be plural, eg: users,posts,comments
I created table Warehouses with create model switch on - no model was created at the server.
So I used compass to create model I checked - the model was created at the app/Models/Warehouse
Now created bread - in the model box I typed app/Models/Warehouse but when I create bread the browser returns error model is not found.
Is there any code I need to change ion the model created by compass?
I uploaded some tables in the database all ending with s - All having primary keys. These tables are showing up in databases. I created models through compass for the tables. But when I am creating bread - all the time the no modl found error comes
Hi there,
The correct model definition should be: App\Models\Warehouse
rather than app/Models/Warehouse
.
Let me know how it goes once you change this.
Use the full namespace in your route files when using the string syntax, for example:
Route::get ('/social-media', 'App\Http\Controllers\SocialMediaController@index')















