Closed nguyenthanhhungbt1905 closed 3 years ago
I'm experiencing the exact same problem. Tried to add a belongsTo relationship in my posts table, where Post belongs to Category. In my case I'm using Post and Category.
In my Post.php
model file which resides in app/Models
directory, I have namespace App\Models;
instead of namespace App;
.
I fixed it by editing the BREAD for my posts table and created a relationship like this:
The fully qualified model name had to be changed in my case: App\Models\Category
instead of App\Category
That's not a bug or a problem, Voyager form asks for "Fully Qualified Model Name (ex. App\Category)"
Usually by default Models in Laravel were created in App
, since Laravel 8 default folder is App\Models
anyway wherever you want to save your Models you need provide the correct fully qualified name.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
When i create relationship in admin panel -> if my model file stored in folder App\Models relation will not success -> If i move model file back to folder App, it will success