create model in laravel using command

In this tutorial he make:model command is used to generate new Eloquent model classes. It requires a name to be supplied; this name will become the name of the generated class and created file. A migration file can also be generated for the model by setting the --migration flag (or by using the -m shortcut). Newly created classes are stored in the app/ directory. Yes are you sure success to follow this step.

The following examples demonstrate how to call the make:model command.

The following would create a new model class for User:

Create a tbl_user Model:

php artisan make:model User 

1: the resulting class would look similar to the following:

?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    //
}

2: The following examples would also generate a migration for the model:


# Create a new User model and migration. 

php artisan make:model User -m

I hope This example is eloquently to the following series of commands:

Leave a Comment