Skip to content

Factory Model Name Resolver Applies to All Factories #54719

@jsuarez8

Description

@jsuarez8

Laravel Version

11.43

PHP Version

8.3

Database Driver & Version

No response

Description

Seems like the UseFactory Attribute isn't working as expected. I'm having an issue since upgrading that everytime i run
php artisan migrate:fresh --seed

i'm getting an error that states:
Class Illuminate\Database\Eloquent\Factories\Factory does not have a property named modelNameResolver

The only way i can fix it is with the steps below

Steps To Reproduce

Seems like this bug was closed but hasn't been resolved yet by: #54642

The way i have fixed it is in src/Illuminate/Database/Eloquent/Factories/Factory.php

Image

Seems to be removing ?? static::$modelNameResolvers[self::class] fixes the issue but im not sure if thats correct

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions