Fill select and select a value with afterStateUpdated

I have tried this, but with a select it does not work correctly:
https://filamentphp.com/docs/3.x/forms/advanced#generating-a-slug-from-a-title

I attach code:
Forms\Components\Select::make('customer_id')
   ->relationship('customer', 'name')
   ->afterStateUpdated(fn (string $operation, Forms\Set $set) => $operation === 'create' ? $set('requested_by', auth()->user()->id) : null)
   ->searchable()
   ->required()
   ->preload()
   ->live(),

Forms\Components\Select::make('requested_by')
   ->relationship('requestedBy', 'name', fn (Builder $query, Get $get) => $query->requestTicket($get('customer_id')))
   ->required(),
Was this page helpful?