Level 10
Try calling it like this in nova:
BelongsToMany::make('Items'),
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have tables called Store and Items . There is a pivot between these 2 tables. I have a belongs to Many relationship on Store and Item Models.
When I try to display the Items connected to store in the Store Details page - Its throwing Class "App\Nova\Admin.store.item" not found
My Store Model :
public function items()
{
return $this->belongsToMany(Item::class, 'store_items', 'store_id', 'item_id')->withPivot('name','price');
}
My Store.php
public static $model = \App\Models\Store::class;
public function fields(Request $request)
{
return [
ID::make()->sortable(),
BelongsToMany::make(__('admin.store.items'), 'items'),
];
}
Can someone point me out where am I going to wrong ..
Please or to participate in this conversation.