May 27, 2022
0
Level 12
Nova custom file field returns null
Hi. I want to create a custom field for laravel nova to upload files to spatie medialibrary. I have this:
<template>
<default-field :field="field" :errors="errors" :show-help-text="showHelpText">
<template slot="field" class="w-full form-control form-input form-input-bordered">
<input
:id="field.name"
type="file"
:class="errorClasses"
:placeholder="field.name"
/>
</template>
</default-field>
</template>
And used it in my resource. But when I send the form, the file field returns null as value, even when i selected an image. Do i have to change the form like in html with multipart or do I have to setup something else?
Please or to participate in this conversation.