Level 3
I also can't figure out why creating and editing in a popup doesn't use the same create and edit page. Normally they should use the same code.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a problem, I can't figure out how to handle the before event in createOptionForm modal form
->before(function () {
// Runs before the form fields are saved to the database.
})
Full code
Forms\Components\Select::make('agreement_id')
->searchable()
->preload()
->relationship('agreement')
->editOptionForm(AgreementResource::getForm())
->createOptionForm(AgreementResource::getForm())
->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->getShortNameAttribute()}"),
Please or to participate in this conversation.