Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Pixelairport's avatar

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?

0 likes
0 replies

Please or to participate in this conversation.