2

I'm developing my first Lumen project and I try to create a seed class for my database.

I'm trying to run the next command:

php artisan make:seeder UsersTableSeeder

But I always get this error:

[Symfony\Component\Console\Exception\CommandNotFoundException]

Command "make:seeder" is not defined.

Did you mean one of these?

  db:seed

  make:migration

I'm searching a lot how to solve that problem but I did'nt find anything. Any ideas what I need to do?

I'm using lumen-framework 5.2.*

Community
  • 1
  • 1
pableiros
  • 14,932
  • 12
  • 99
  • 105
  • 1
    It's not available in Lumen. Many of the artisan helpers like that are not in Lumen. – jszobody Jun 20 '16 at 17:22
  • That doesn't mean you can't use the seeder (I don't think). You just don't have a generator, need to create the class yourself. Like [this guy](http://loige.co/developing-a-web-application-with-lumen-and-mysql/#seedthedatabase) did. – jszobody Jun 20 '16 at 17:24
  • @jszobody ok I'm guessing I'm going to start doing manually the seeding classes, Thank you – pableiros Jun 20 '16 at 17:28

1 Answers1

12

make:seeder command is not available in Lumen.

To see all built-in commands, use the php artisan command in Lumen.

So, you will need to write the codes by yourself. What you can do is copy the skeleton file from Laravel and use it as a starter in your Lumen project.

  • Here is the gist that I have created for this sole purpose. https://gist.github.com/samundra/901cd62fa98f0673b1cbbeec2ec17c3b you can add it to `App/Providers/MakeSeedServiceProvider.php` and load it as `$app->register(App\Providers\MakeSeedServiceProvider::class);`. Now you'll have 'make:seeder' – Samundra Feb 12 '17 at 09:57