Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel make model with migration

I'm creating a model on the Laravel 5 with this command:

php artisan make:model Settings 

As it shows on the video lessons that as soon as model is created, new migration file also must be created. But, in my situtation, migration is not being created. How can I get the migration generated when model is created?

composer.json:

...     "require": {             "php": ">=5.5.9",             "laravel/framework": "5.1.*"         }, ... 
like image 255
nsv Avatar asked Jul 31 '15 06:07

nsv


People also ask

What is difference between model and migration in Laravel?

A model is a class representation of a database column. A migration is the database table schema, it simply describes the database columns.

Should I use migration in Laravel?

In Laravel, Migration provides a way for easily sharing the schema of the database. It also makes the modification of the schema much easier. It is like creating a schema once and then sharing it many times.


1 Answers

I'm guessing your build of L5 is fairly old, as they disabled creating migrations alongside the model creation.

Try running the ff:

php artisan make:model Settings --migration 
like image 104
davsp Avatar answered Sep 19 '22 02:09

davsp