Select::make('video_id')
->relationship('video', 'title')
->searchable()
->allowHtml()
->required()
->getSearchResultsUsing(function (string $search) {
// some irrelevant code
})
->getOptionLabelUsing(function (int $value): string {
// some irrelevant code
})
->suffixAction(
Action::make('edit')
->icon('heroicon-m-pencil-square')
->action(function ($state, ?Model $record) {
// go to video edit page
// somehow trigger form save before navigating away
info("Edit video with id: $state");
})
),
Select::make('video_id')
->relationship('video', 'title')
->searchable()
->allowHtml()
->required()
->getSearchResultsUsing(function (string $search) {
// some irrelevant code
})
->getOptionLabelUsing(function (int $value): string {
// some irrelevant code
})
->suffixAction(
Action::make('edit')
->icon('heroicon-m-pencil-square')
->action(function ($state, ?Model $record) {
// go to video edit page
// somehow trigger form save before navigating away
info("Edit video with id: $state");
})
),