-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
How to upload files? #39
Comments
Hey, This is more than likely related to you not correctly defining your avatar field within one of your wizard steps.
At the end of each step, Arcanist will save the data if defined within your steps and you will then be able to access this via the $payload variable on the WizardAction. Provide me with your avatar upload step so I can assist you more. Thanks |
Thanks for your reply! I'm working with Inertia.js.
Note:
|
Arcanist doesn’t natively understand how to deal with file uploads. What you want to do in this case is define a transformer for the Field::make('avatar')
->rules(['required', 'file', 'mimes:png,jpg,jpeg'])
->transform(function (UploadedFile $file) {
return $file->store('avatars');
}); Note that this means that the file gets stored when the step gets submitted, not when the wizard is finished. In your action, you would then be able to grab the filename via |
Thanks a lot! This is what i suspected)) |
Hi, It seems like it is not enogh to put
|
Hi,
I'm experiencing with this package and I have a trouble with file uploading:
WizardAction
I'm reading a file field (e.g. avatar) through$payload
and i want to do something likeStorage::putFile('avatars', $payload['avatar']);
to store file in a local storage, but$payload['avatar']
is always an empty array. How to fix that?The text was updated successfully, but these errors were encountered: