2

I'm trying to follow a tutorial on using command prompt in Windows. It's called Laravel Tutorial: Step by Step Guide to Building Your First Laravel Application and I'm stuck in seed :

use Illuminate\Database\Seeder;

class TestingTableSeeder extends Seeder
{
  public function run()
  {
    factory:(App\Testing::class, 5)->create();
  }
}

I already tried solutions from other question on Stack Overflow but I'm unable to fix the error.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ihsan Dn
  • 31
  • 8

2 Answers2

2

It should be:

factory(App\Testing::class, 5)->create();

instead of

factory:(App\Testing::class, 5)->create();
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
0

You are calling the factory function wrong, remove the colon(:) after that as:

use Illuminate\Database\Seeder;

class TestingTableSeeder extends Seeder
{
    public function run()
    {
       factory(App\Testing::class, 5)->create();
    }
}
halfer
  • 19,824
  • 17
  • 99
  • 186
RAUSHAN KUMAR
  • 5,846
  • 4
  • 34
  • 70