public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name'),
]);
}
public function table(Table $table): Table
{
$table = MyResource::table($table);
return $table
->filters([])
->headerActions(actions: [
Tables\Actions\CreateAction::make()
->formData([
'name' => 'hoo', // nope, doesn't work
])
->mutateFormDataUsing(function (array $data): array {
\Log::info('mutateFormDataUsing: never gets called');
$data['name'] = 'goo';
return $data;
})
->beforeFormFilled(function () {
\Log::info('beforeFormFilled: called, but doesn\'t seem to do anything');
$data['name'] = 'foo';
return $data;
})
->modalWidth('7xl')
->createAnother(false),
]);
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name'),
]);
}
public function table(Table $table): Table
{
$table = MyResource::table($table);
return $table
->filters([])
->headerActions(actions: [
Tables\Actions\CreateAction::make()
->formData([
'name' => 'hoo', // nope, doesn't work
])
->mutateFormDataUsing(function (array $data): array {
\Log::info('mutateFormDataUsing: never gets called');
$data['name'] = 'goo';
return $data;
})
->beforeFormFilled(function () {
\Log::info('beforeFormFilled: called, but doesn\'t seem to do anything');
$data['name'] = 'foo';
return $data;
})
->modalWidth('7xl')
->createAnother(false),
]);