poser icon indicating copy to clipboard operation
poser copied to clipboard

Generator doesn't take into account custom namespaces for factory

Open hailwood opened this issue 4 years ago • 1 comments

My models are in app\Models so the namespace is \App\Models

In the config file I have "models_namespace" => "App\\Models\\",

And I am generating the factories using make:poser -f so it knows the right namespace.

However the generated factories end up assuming the namespace is just \App e.g.

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Company;
use Faker\Generator as Faker;

$factory->define(Company::class, function (Faker $faker) {
    return [
        //
    ];
});

hailwood avatar Jun 05 '20 01:06 hailwood

Hi @hailwood

I'll take a look into this. Thanks for the bug report! You're a 🌟

lukeraymonddowning avatar Jun 06 '20 12:06 lukeraymonddowning