dev-master
9999999-devExtension of built-in Laravel 'make' Commands
MIT
The Requires
by Eric Fletcher
laravel commands make
v1.0
1.0.0.0Extension of built-in Laravel 'make' Commands
MIT
The Requires
by Eric Fletcher
laravel commands make
Wallogit.com
2017 © Pedro Peláez
Extension of built-in Laravel 'make' Commands
, (*1)
LaraMake is a package that overrides the built-in artisan make commands to add command options that we believe should have been included out-of-the-box, but weren't., (*2)
Laravel doesn't want to bloat their commands with too many flags, so we'll do it for them!, (*3)
Require the package with Composer:, (*4)
composer require thefletcher/laramake
Add the Service Provider to config/app.php:, (*5)
'providers' => [
// Laravel Framework Service Providers...
// ...
// Package Service Providers
TheFletcher\LaraMake\LaraMakeServiceProvider::class,
// ...
// Application Service Providers
// ...
],
Verify that Artisan is using the new commands:, (*6)
php artisan make:model --help
You should see new options available, including --table, (*7)
Below are the commands that have been overridden and what options were added., (*8)
This command creates a Model class., (*9)
New options include:, (*10)
| Long | Short | Purpose | Example |
|---|---|---|---|
--namespace={namespace} |
Set the namespace to put the model in. | --namespace=App\Models |
|
--table={table} |
-t={table} |
Set the table name for the model to use. | --table=products |
--no-timestamps |
Set $timestamps=false to tell the model not to expect created_at or updated_at fields. |
--no-timestamps |
|
--primarykey={key} |
-k={key} |
Set a custom primary key for the model. | --primarykey=id |
--no-incrementing |
Set $incrementing = false to tell the model that it's primary key is not auto-incrementing. |
--no-incrementing |
|
--connection={conn} |
Set the $connection the model should use. |
--connection=mongodb |
|
This command creates a ServiceProvider class., (*11)
New options include:, (*12)
| Long | Short | Purpose | Example |
|---|---|---|---|
--defer |
-d |
Set $defer to defer loading of the Provider. |
--defer |
If there are any options you wish Laravel had and would like added here, please create an issue through Github., (*13)
If you wish to work on adding new options, I welcome Pull Requests, but only after discussion in an issue first., (*14)
Much like the Laravel Framework, this package is open-sourced software licensed under the MIT license., (*15)
Extension of built-in Laravel 'make' Commands
MIT
laravel commands make
Extension of built-in Laravel 'make' Commands
MIT
laravel commands make