orchidsoftware / platform

Orchid is a @laravel package that allows for rapid application development of back-office applications, admin/user panels, and dashboards.
https://orchid.software
MIT License
4.4k stars 646 forks source link

validating upload & handle matrix delete #2661

Closed AlizHarb closed 1 year ago

AlizHarb commented 1 year ago

Hello I'm facing a problem with validating using Upload input Upload::make('item.attachment') ->title('Item Image') ->maxFiles(1) ->acceptedFiles('image/*') ->groups('items') ->storage('public') ->media(), $request->validate([ 'item.attachment' => 'required|image' ]);

Also i have one extra question, how can i handle the matrix deletion?

thanks

AlizHarb commented 1 year ago

anyone about validating the attachments?

MercerMorning commented 1 year ago

@AlizHarb Hi, i think it's impossible to validate uploaded files, because they save once you attached them. Frontend make post request (systems/files) using axios. You can validate only ids of saved attachments in your screen. I think you should try to make your own form element