© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
20 replies
Abi

No morph map defined for model

I get the following error on the edit page of the User Resource on the admin panel and not sure what may be the issue

No morph map defined for model [App\Models\User].
No morph map defined for model [App\Models\User].


My form method has the following code
 public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('name')
                    ->required()
                    ->disabled()
                    ->maxLength(255),
                Forms\Components\TextInput::make('email')
                    ->email()
                    ->required()
                    ->disabled()
                    ->maxLength(255),
                Forms\Components\TextInput::make('additionalDetail.user_type')
                    ->label('User Type'),

                Forms\Components\Fieldset::make('Address')
                    ->relationship('additionalDetail')
                    ->disabled()
                    ->schema([
                        Forms\Components\TextInput::make('phone'),
                        Forms\Components\TextInput::make('city')
                            ->label('City')
                            ->maxLength(255),
                        Forms\Components\TextInput::make('user_type')
                            ->label('User Type')
                            ->maxLength(255),
                    ]),
            ]);
    }
 public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('name')
                    ->required()
                    ->disabled()
                    ->maxLength(255),
                Forms\Components\TextInput::make('email')
                    ->email()
                    ->required()
                    ->disabled()
                    ->maxLength(255),
                Forms\Components\TextInput::make('additionalDetail.user_type')
                    ->label('User Type'),

                Forms\Components\Fieldset::make('Address')
                    ->relationship('additionalDetail')
                    ->disabled()
                    ->schema([
                        Forms\Components\TextInput::make('phone'),
                        Forms\Components\TextInput::make('city')
                            ->label('City')
                            ->maxLength(255),
                        Forms\Components\TextInput::make('user_type')
                            ->label('User Type')
                            ->maxLength(255),
                    ]),
            ]);
    }

and the relation on the User model is as follows:

    public function additionalDetail(): HasOne
    {
        return $this->hasOne(UserAdditionalDetail::class, 'user_id', 'id');
    }
    public function additionalDetail(): HasOne
    {
        return $this->hasOne(UserAdditionalDetail::class, 'user_id', 'id');
    }


User model has the following additions from the default

class User extends Authenticatable implements MustVerifyEmail, FilamentUser
{
    use HasApiTokens;
    use HasFactory;
    use HasProfilePhoto;
    use Notifiable;
    use TwoFactorAuthenticatable;
    use HasRoles;

    protected $guard_name = 'web';
class User extends Authenticatable implements MustVerifyEmail, FilamentUser
{
    use HasApiTokens;
    use HasFactory;
    use HasProfilePhoto;
    use Notifiable;
    use TwoFactorAuthenticatable;
    use HasRoles;

    protected $guard_name = 'web';
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

No hint path defined for [forms]
FilamentFFilament / ❓┊help
3y ago
Morph CheckboxList
FilamentFFilament / ❓┊help
3y ago
error No query results for model in model when testing
FilamentFFilament / ❓┊help
3y ago
FileUpload And Morph
FilamentFFilament / ❓┊help
3y ago