Skip to content
Discussion options

You must be logged in to vote

The problem solved by adding newFactory method to Student model:

/**
     * Create a new factory instance for the model.
     *
     * @return \Illuminate\Database\Eloquent\Factories\Factory
     */
    protected static function newFactory()
    {
        return \Database\Factories\StudentFactory::new();
    }

and fixing the Student model namespace in factory class:

use App\Models\Student; => use App\Models\Student\Student;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AmRo045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant