xoco70 / laravel-tournaments

Laravel Package that allows you to generate customizable tournaments trees. - This project repo is no longer being maintained
GNU General Public License v3.0
228 stars 51 forks source link

Unable to locate factory with name [default] [Illuminate\Foundation\Auth\User] when setting up the demo using Laravel 5.5 #9

Closed AhSem closed 6 years ago

AhSem commented 6 years ago

Hi, using Laravel 5.5, I ran into the following error when running

php artisan db:seed --class=LaravelTournamentSeeder.

[InvalidArgumentException]
Unable to locate factory with name [default] [Illuminate\Foundation\Auth\Us
er].

xoco70 commented 6 years ago

Can you please detail what is your use case?

New laravel or existing project? Is there any URL to it?

did you tried composer dump-autoload

I just tested installation in a brand new laravel 5.5 and I get it working.

Give me some more details so I can help!

AhSem commented 6 years ago

Steps:

  1. composer create-project --prefer-dist laravel/laravel tournament -- OK
  2. composer require "xoco70/laravel-tournaments":^0.13 -- OK
  3. php artisan vendor:publish --tag=laravel-tournaments -- OK. 4 things being copied, namely, migrations, seeds, factories and resources/assets
  4. php artisan migrate -- plenty of files migrated
  5. composer dump-autoload -- OK
  6. php artisan db:seed --class=LaravelTournamentSeeder

Seeding... Seeding: VenueSeeder Venues seeding! Seeding: CategorySeeder Seeding: TournamentSeeder Seeding: CompetitorSeeder Competitors seeding!

[InvalidArgumentException]
Unable to locate factory with name [default] [Illuminate\Foundation\Auth\Us
er].

xoco70 commented 6 years ago

Ohh, I see.

For now, you can do this in database/factories/UserFactory

Replace $factory->define(App\User::class, function (Faker $faker) { By $factory->define(Illuminate\Foundation\Auth\User::class, function (Faker $faker) {

WIth that, it should work, while I publish a fix.

xoco70 commented 6 years ago

I added --force to publish line in README.md, that should solve this issue

AhSem commented 6 years ago

Confirmed resolved.