This commit is contained in:
2023-12-04 16:50:02 +05:00
parent 4f33f0059a
commit 2fcd789cf1
2 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ class LoanOrderFieldsForIndex
/**
* Loan Order fields for "create"
*/
public static function make(): array
public static function make($resource): array
{
return [
ID::make()->hide(),
@@ -32,11 +32,11 @@ class LoanOrderFieldsForIndex
Select::make(__('Region'), 'region')
->displayUsingLabels()
->options(RegionRepo::values())
->canSeeWhen('isAdmin', $this)
->canSeeWhen('isAdmin', $resource)
->sortable(),
BelongsTo::make(__('Branch'), 'branch', Branch::class)
->canSeeWhen('isAdmin', $this)
->canSeeWhen('isAdmin', $resource)
->sortable(),
Text::make(__('Name'), 'customer_name'),

View File

@@ -129,7 +129,7 @@ class LoanOrder extends Resource
*/
public function fieldsForIndex(NovaRequest $request): array
{
return LoanOrderFieldsForIndex::make();
return LoanOrderFieldsForIndex::make($this);
}
/**