Why Repeater items are not sent to the backend ?

Here I change the model explicitly
->model(Product::class)
->model(Product::class)
class ManageProductClients extends ManageRelatedRecords
{
protected static string $resource = ProductResource::class;

protected static string $relationship = 'clients';

protected static ?string $navigationIcon = 'heroicon-o-banknotes';


public function form(Form $form): Form
{
return $form
->schema(
[
Forms\Components\Repeater::make('Clients')
->model(Product::class)
->relationship('clients')
->schema([
Forms\Components\Section::make()
->schema([
Forms\Components\Select::make('client_id')
->required()
->live()
->relationship('client', 'name')
])->columns(4),
])
->columnSpanFull(),
]
);
}
}
class ManageProductClients extends ManageRelatedRecords
{
protected static string $resource = ProductResource::class;

protected static string $relationship = 'clients';

protected static ?string $navigationIcon = 'heroicon-o-banknotes';


public function form(Form $form): Form
{
return $form
->schema(
[
Forms\Components\Repeater::make('Clients')
->model(Product::class)
->relationship('clients')
->schema([
Forms\Components\Section::make()
->schema([
Forms\Components\Select::make('client_id')
->required()
->live()
->relationship('client', 'name')
])->columns(4),
])
->columnSpanFull(),
]
);
}
}
This is my table action
->headerActions([
Tables\Actions\CreateAction::make()
->modalWidth('7xl'),
])
->headerActions([
Tables\Actions\CreateAction::make()
->modalWidth('7xl'),
])
5 Replies
Dennis Koch
Dennis Koch4mo ago
They are. You are using ->relationship() which means those items are directly saved to the relationship for you.
Asmit Nepali
Asmit NepaliOP4mo ago
@Dennis Koch Thanks for the reply The issue is cause by repeater filed, If I remove repeater then it pass the data but with repeater the data are not passed.
LeandroFerreira
LeandroFerreira4mo ago
if you want to access this in the $data array, add dehydrated() in the repeater
Dennis Koch
Dennis Koch4mo ago
What are you trying to do?
Asmit Nepali
Asmit NepaliOP4mo ago
I try to add repeater on MRR (Manage Relationship Record) by providing the model like
->model(Product::class)
->model(Product::class)
on
$form
$form
Want results from more Discord servers?
Add your server