0
resolve(name: PrincipalDependantWrapper::class)
    ->relationship(
        fn (callable $get, PrincipalBuilder $query) => $query
            ->whereRelation(
                relation: 'warehouses',
                column: 'warehouse_id',
                operator: '=',
                value: $get('warehouse_id')
            )
    )
    ->disabled()
    ->searchable()
    ->afterStateUpdated(function (callable $set) {
        $set('item_id', null);
    })
    ->execute(),

I try to modify Ul of this section and it show's:

> "Filament\Forms\Components\Select::searchable(): Argument #1 ($condition) must be of type Closure|array|bool, null given, called in C:\laragon\www\wms-main\app\Filament\Resources\Shared\Profile\Principal\PrincipalRelation.php on line 35"

So below code is taken from PrincipalRelation.php:

return Forms\Components\Select::make(name: static::getIdentifier())
    ->relationship(
        relationshipName: 'principal',
        titleColumnName: 'code',
        callback: $this->relationship)
    ->afterStateUpdated(callback: $this->afterStateUpdated)
    ->reactive()
    ->preload()
    ->disabled(condition: $this->disabled)
    ->tap(function (Forms\Components\Select $component): void {
        if ($this->disabledOn) {
            $component->disabledOn($this->disabledOn);
        }
    })
    ->searchable(condition: $this->searchable)
    ->required(condition: $this->required);

I don know what's wrong with my code.

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43

0 Answers0