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.26k stars 631 forks source link

Do not automatically upload attachments #2648

Closed stonedleaf closed 12 months ago

stonedleaf commented 1 year ago

Is your feature request related to a problem? Please describe. When adding image/attachment to a form, the uploaded file on the Picture field is saved to the database and stored. However, the user did not submit the form. The uploaded file and database record becomes a waste of space that needs to be manually checked.

Describe the solution you'd like Do not save a record in the database or move to storage when the form is not yet submitted

Describe alternatives you've considered Create my own Field class

Additional context n/a

tabuna commented 1 year ago

You don't need to create a custom field. Instead, you can utilize a regular file input field in your HTML form. This will enable users to choose a file from their computer and submit it with the form. Once the form is processed on the server, you will have access to the submitted file and can perform any required actions accordingly.

Input::make('...')->type('file')