How to mutate data on form submit of Relation Manager?

Its all in the question:)
1 Reply
Matthew
Matthew7mo ago
I tried this, but it didnt work:/
class TestRelationManager extends RelationManager
{
use InteractsWithForms;
public ?array $data = [];
protected static string $relationship = 'test';

public function mount(): void
{
$this->form->fill();
}

public function form(Form $form): Form
{
return $form
->schema([
// ...

])->columns(3)->statePath('data');
}

public function create(): void
{
dd($this->form->getState());
}

public function table(Table $table): Table
{
return $table
// ...
}
}
class TestRelationManager extends RelationManager
{
use InteractsWithForms;
public ?array $data = [];
protected static string $relationship = 'test';

public function mount(): void
{
$this->form->fill();
}

public function form(Form $form): Form
{
return $form
->schema([
// ...

])->columns(3)->statePath('data');
}

public function create(): void
{
dd($this->form->getState());
}

public function table(Table $table): Table
{
return $table
// ...
}
}
But I dont have a blade file, so technically create() is never called