Repeater::make('notes')
->relationship('notes')
->schema([
Forms\Components\Textarea::make('contents')
->label(fn (Get $get) => User::whereId($get('creator'))->first()->full_name . " - Created at: " . Carbon::parse($get('created_at')) ?? 'Add Note')
->maxLength(65535)
->required(),
Forms\Components\Checkbox::make('send_as_email')
->hiddenOn('view')
->label('Send note as email to client?')
->helperText('This sends the contents of the note to the client of this task, as an email.')
->default(false),
])
->mutateRelationshipDataBeforeCreateUsing(function (array $data) {
$data['creator'] = auth()->id();
return $data;
})
->columnSpanFull()
->defaultItems(0),
Repeater::make('notes')
->relationship('notes')
->schema([
Forms\Components\Textarea::make('contents')
->label(fn (Get $get) => User::whereId($get('creator'))->first()->full_name . " - Created at: " . Carbon::parse($get('created_at')) ?? 'Add Note')
->maxLength(65535)
->required(),
Forms\Components\Checkbox::make('send_as_email')
->hiddenOn('view')
->label('Send note as email to client?')
->helperText('This sends the contents of the note to the client of this task, as an email.')
->default(false),
])
->mutateRelationshipDataBeforeCreateUsing(function (array $data) {
$data['creator'] = auth()->id();
return $data;
})
->columnSpanFull()
->defaultItems(0),