© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Algorithm

FileUpload doesn't accept MorphTo.

This is the product model:
    public function photo(): MorphOne
    {
        return $this->morphOne(Photo::class, 'photoable');
    }
    public function photo(): MorphOne
    {
        return $this->morphOne(Photo::class, 'photoable');
    }


This is the photo model:
    public function photoable(): MorphTo
    {
        return $this->morphTo();
    }
    public function photoable(): MorphTo
    {
        return $this->morphTo();
    }


This is the resource:
                FileUpload::make('photo')
                    ->image()
                    ->placeholder(__('Photo')),
                FileUpload::make('photo')
                    ->image()
                    ->placeholder(__('Photo')),


When I upload then the photo table is empty.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

FileUpload It doesn't preview
FilamentFFilament / ❓┊help
2y ago
FileUpload component doesn't show uploaded image
FilamentFFilament / ❓┊help
3y ago
Searchable MorphTo
FilamentFFilament / ❓┊help
16mo ago
morphTo relationship
FilamentFFilament / ❓┊help
3y ago