F
Filament8mo ago
rabol

is there a 'before the create button is clicked hook'

It might not be a big issue, but I just discovered that in one have a upload comonemt in a form e.g. like this:
Forms\Components\FileUpload::make('thumbnail')
->disk(config('filesystems.default'))
->directory('articles')
->visibility('public')
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
])
->required(),
Forms\Components\FileUpload::make('thumbnail')
->disk(config('filesystems.default'))
->directory('articles')
->visibility('public')
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
])
->required(),
while this works it will give issues in some cases where the 'filesystems.default' is set to 'local' or if the the configuration does not have a 'url' key, in that case it would be nice to be able to do some validation even before allowing the user to create a new record. I know that there is beforValidate() and beforCreate(), but in this case the user has already entered some information in the form is there a way to do something just before the create button is pressed ?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server