Closed carloscgo closed 5 years ago
which version you used in nova-tab and nova-belongsto-depend?
I tried in nova-tab(0.2.0) and nova-belongsto-depend(master) and working well.
can you provide code and specific description?
Same issue here: "arsenaltech/nova-tab": "^0.2.0", "orlyapps/nova-belongsto-depend": "^0.0.6",
I don't understand why
Can you provide fields method code in the resource?
Hello @CasperLaiTW, this is what I have inside the fields() method in the resource class:
BelongsTo::make('Operation')->rules('required'),
BelongsTo::make('Currency')->rules('required'),
Number::make('Amount')->min(1)->max(999999999999)->step(1)->rules('required'),
NovaBelongsToDepend::make('Zone')->options(\App\Zone::all())->onlyOnForms(),
NovaBelongsToDepend::make('Area')->optionsResolve(function ($zone) {
return $zone->areas()->get(['id','name']);
})->dependsOn('Zone')->rules('required')->hideFromIndex(),
My code is used nova-tab, i retrieve error "Can not find the Field "province" in the Model "App\Nova\Customers":
new NovaTab('Address Information', [
NovaBelongsToDepend::make('Country')
->options(\App\Models\Countries::all())
->rules('required'),
NovaBelongsToDepend::make('Province')
->optionsResolve(function ($country) {
return $country->Provinces()->select(['id', 'exonimo_en AS name'])->get(['id', 'name']);
})
->dependsOn('Country')
->rules('required'),
Text::make('City')
->hideFromIndex()
->rules('required', 'max:45'),
Text::make('Zip Code', 'zip_code')
->hideFromIndex()
->rules('required', 'max:10'),
Place::make('Address')
->rules('required')
->hideFromIndex(),
]),
Hi @emilianotisato @carloscgo
I fixed from my local, so I didn't get the issue, and now I create PR for the issue.
you can use my fork before @orlyapps accepted PR
Guys, you can update composer.json
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"repositories": [
{
"type": "vcs",
"url": "git@github.com:CasperLaiTW/nova-belongsto-depend.git"
},
],
"require": {
"orlyapps/nova-belongsto-depend": "dev-master",
}
}
I have a collision with use package arsenaltech/nova-tab, the field province no found. But when remove this tab the field work perfect.