Juliatzin
Juliatzin

Reputation: 19695

This use statement conflicts with another class in this namespace

I developed a Laravel plugin, and, in all my factory classes, I get a warning from Scrutinizer that tells me:

use Xoco70\KendoTournaments\Models\Category;

This use statement conflicts with another class in this namespace, Category, in

$factory->define(Category::class, function (Faker\Generator $faker) { 

... }

Thing is I have it defined it package/xoco70/my-plugin/src and in /vendor/xoco70/my-plugin/src/

Is there something I can do about it?

Upvotes: 2

Views: 144

Answers (1)

Andrii Lutskevych
Andrii Lutskevych

Reputation: 1379

Try use as:

use Xoco70\KendoTournaments\Models\Category as XocoCategory;

And the use this alias:

$factory->define(XocoCategory::class, function (Faker\Generator $faker) {
    ...
}

Documentation

Upvotes: 1

Related Questions