# this one works as expected
Repeater::make('projects')
->relationship('projects')
->schema([
TextInput::make('name')
->formatStateUsing(fn ($record) => $record?->name),
TextInput::make('status')
->formatStateUsing(fn ($record) => $record?->status),
]),
TextInput::make('# projects')
->hintAction(
Action::make('view projects')
->form([
# this one though, within an action form on the same page...
Repeater::make('projects')
->relationship('projects')
->schema([
# ... $record is null, calculated state fails
TextInput::make('name')
->formatStateUsing(fn ($record) => $record?->name),
TextInput::make('status')
->formatStateUsing(fn ($record) => $record?->status),
])
])
),
# this one works as expected
Repeater::make('projects')
->relationship('projects')
->schema([
TextInput::make('name')
->formatStateUsing(fn ($record) => $record?->name),
TextInput::make('status')
->formatStateUsing(fn ($record) => $record?->status),
]),
TextInput::make('# projects')
->hintAction(
Action::make('view projects')
->form([
# this one though, within an action form on the same page...
Repeater::make('projects')
->relationship('projects')
->schema([
# ... $record is null, calculated state fails
TextInput::make('name')
->formatStateUsing(fn ($record) => $record?->name),
TextInput::make('status')
->formatStateUsing(fn ($record) => $record?->status),
])
])
),