Skip to content
Rails-style code generator commands for models, controllers, etc.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/stubs
src
.gitignore
README.md
composer.json
composer.lock

README.md

Laravel Generate

Generate models and controllers with a Rails-style database field definitions:

php artisan g:model <name> [field[:type][:index] field[:type][:index]]

For example, the following command would create a model and migration:

artisan g:model Car make model certified_at:datetime msrp:float

The migration would look like:

public function up()
{
    Schema::create('cars', function (Blueprint $table) {
        $table->increments('id');
        $table->string('make');
        $table->string('model');
        $table->dateTime('certified_at');
        $table->float('msrp');
        $table->timestamps();
    });
}
You can’t perform that action at this time.