phucpm/generators

Module generators.

1.4 2016-05-14 08:32 UTC

This package is not auto-updated.

Last update: 2021-05-01 00:25:15 UTC


README

Step 1: Install Through Composer

composer require phucpm/generators --dev

Step 2: Add the Service Provider

You'll only want to use these generators for local development, so you don't want to update the production providers array in config/app.php. Instead, add the provider in app/Providers/AppServiceProvider.php, like so:

public function register()
{
	if ($this->app->environment() == 'local') {
		$this->app->register('PhucPM\Generators\GeneratorsServiceProvider');
	}
}

Step 3: Run Artisan!

You're all set. Run php artisan from the console, and you'll see the new commands in the make:* namespace section.

Examples

Basic Example

php artisan make:module Category --namespace=IZee

Or

php artisan make:module Category --namespace=IZee --only="delete,index"

Or

php artisan make:module Category --namespace=IZee --except="delete,index"

Step 4: Add the Service Provider

Instead, add the provider in app/Providers/AppServiceProvider.php, like so:

public function register()
{
    $this->app->singleton('App\IZee\Categories\CategoryRepositoryInterface', 'App\IZee\Categories\DbCategoryRepository');
}