Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

Lumen (Laravel) Eloquent php artisan make:model not defined

I use Lumen 1.0 for an API project.

I have already enable Eloquent by uncomment the following line in bootstrap/app.php file :

$app->withEloquent();

But when I want to create my first model with migration it fails :

php artisan make:model Book --migration

Error message :

  [InvalidArgumentException]
  Command "make:model" is not defined.
  Did you mean one of these?
      make:seeder
      make:migration

Laravel doc about Eloquent (http://laravel.com/docs/5.1/eloquent#defining-models).

Lumen doc (http://lumen.laravel.com/docs/installation) doesn't include Eloquent doc because, it's not enable by default.

Do you have any ideas to avoid this error ?

Add details

php artisan --version

Displays :

Laravel Framework version Lumen (5.1.6) (Laravel Components 5.1.*)
question from:https://stackoverflow.com/questions/34339517/lumen-laravel-eloquent-php-artisan-makemodel-not-defined

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You're seeing this error because Lumen doesn't come with make:model.

To see a list of all the artisan commands you have at your disposal just run php artisan.

That being said I did just find this package which I've added to a lumen installation and it seems to work fine https://github.com/webNeat/lumen-generators#installation

Hope this helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...