© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
14 replies
Jamie Cee

File Upload within a custom page is null

So My page resource
    <x-filament-panels::form wire:submit="submit">
        {{ $this->form }}
        <div>
            <x-filament::button type="submit" size="sm" wire:loading.attr="disabled" wire:target="submit"
                wire:loading.class="opacity-50 cursor-not-allowed">
                Verify
            </x-filament::button>
        </div>
    </x-filament-panels::form>
    <x-filament-panels::form wire:submit="submit">
        {{ $this->form }}
        <div>
            <x-filament::button type="submit" size="sm" wire:loading.attr="disabled" wire:target="submit"
                wire:loading.class="opacity-50 cursor-not-allowed">
                Verify
            </x-filament::button>
        </div>
    </x-filament-panels::form>

And my form im using the spatie media library file upload component
    /**
     * Form Schema
     *
     * @param Form $form
     * @return Form
     */
    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('name'),
            SpatieMediaLibraryFileUpload::make('media')
        ])
            ->statePath('data');
    }

    public function submit()
    {
        $data = $this->form->getState();
        dd($data);
    }
    /**
     * Form Schema
     *
     * @param Form $form
     * @return Form
     */
    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('name'),
            SpatieMediaLibraryFileUpload::make('media')
        ])
            ->statePath('data');
    }

    public function submit()
    {
        $data = $this->form->getState();
        dd($data);
    }


But in my dd() I only see name, there is nothing regarding the file upload part. Is there something im missing that I cant see in the documentation?
Solution
So something like this
    public function submit()
    {
        $model = MyModel::create($this->form->getState());
        $this->form->model($model)->saveRelationships();
    }
    public function submit()
    {
        $model = MyModel::create($this->form->getState());
        $this->form->model($model)->saveRelationships();
    }
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Form within a custom page
FilamentFFilament / ❓┊help
3y ago
filament v3: file upload on custom page
FilamentFFilament / ❓┊help
3y ago
Filament File Upload Custom Relationship
FilamentFFilament / ❓┊help
16mo ago
Problem with Custom rules - upload file
FilamentFFilament / ❓┊help
12mo ago