Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Upload fields #5

Open
ksassnowski opened this issue May 7, 2021 · 2 comments
Open

File Upload fields #5

ksassnowski opened this issue May 7, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ksassnowski
Copy link
Collaborator

ksassnowski commented May 7, 2021

This is currently just a vague idea that popped into my mind. I think it should be possible to define a Field as an upload or something similar and let Arcanist take care of actually saving the file.

Currently, you would have to implement the process method of the Step to deal with uploaded files. This is something I want to discourage as much as possible and provide built-in solutions to problems that require that escape hatch instead.

The API could look something like this

Field::make('avatar')
    ->file()
    ->saveTo(storage_path('avatars'));

Arcanist could then take care of saving the uploaded file using whatever storage you have configured in your application and store the file path in the avatar key.

This idea could potentially be generalized further to add more behavior to fields.

@ksassnowski ksassnowski added the enhancement New feature or request label May 7, 2021
@ksassnowski
Copy link
Collaborator Author

Sooo... basically reimplementing Nova, I guess 😅

@ksassnowski ksassnowski added this to the 0.3.0 milestone May 9, 2021
@ksassnowski ksassnowski self-assigned this May 12, 2021
@AbdullahFaqeir
Copy link

Would it be okay if I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants