Download the PHP package skagarwal/generators without Composer
On this page you can find all versions of the php package skagarwal/generators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skagarwal/generators
More information about skagarwal/generators
Files in skagarwal/generators
Package generators
Short Description Directory Structure Laravel 5.1 Generator.
License MIT
Informations about the package generators
This project is not maintained anymore.
Laravel-5.1-Generators
If you like to keep your laravel appliaction in well formed structure and tired of making all the directories and subdirectories manually for every model, Then this package will help you automate this process.
This Package Strictly Follows The Directory Structure:
Avaiabale Commands:
create:model
create:repository
create:event
create:listener
create:job
Few More to Come
Usage
Step 1: Install Through Composer
Step 2: Add the Service Provider
Add the SKAgarwal\Generators\GeneratorsServiceProvider
to the Config/app.php
's providers
array
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.
Commands
create:model
Description:
- Creates a model, migration and the directory structure.
Arguments:
model
- Required. Name of the model to be created.
Options:
--migration
- Optional. If provided, Migration for the Model will be created.
usage:
This will produce the Following:
And since --migration
option is provided, there will be a migration for Foo
in Database\Migrations\
.
-
create:repository
Description:
- Creates a repository interface and its eloquent implimentation in respective directories.
Arguments:
model
- Required. The Model Name. Repository Will Be Created Under This Model Directory.
Options:
--repository
- Optional. The Repository Name to be created. If not provided, Repository with the Model Name will be created.
Usage:
This will produce:
If --repository=Bar
or -r Bar
is provided, then it will produce:
Note:
-
Do not forget to bind the interface to its implimentation in Service container.
-
create:event
Description:
- Creates a event class in
{model}/Events/
directory.
Arguments:
name
- Required. Name of the event class.
Options:
model
- Required. Name of the model the event belongs to.
Usage:
This will produce:
-
create:listener
Description:
- Creates a event listener in
{model}\Listeners\
directory.
Arguments:
name
- Required. Name of the event listener.
Options:
model
- Required. Name of the model lsitener belongs to.event
- Required. Name fo the event listener is being listened for.queued
- Optional Indicated listener should be queued.
Usage:
This will produce:
Note:
-
Do not forget to register the listener for the event in
EventServiceProvider
. -
create:job
Description:
- Creates a job in
{model}\Jobs\
directory.
Arguments:
name
- Required. Name of the job.
Options:
model
- Required. Name of the model job belongs to.queued
- Optional Indicated listener should be queued.
Usage:
This will produce:
-
create:policy
Description:
- Creates a policy in
{model}\Policies\
directory.
Arguments:
name
- Required. Name of the policy.
Options:
model
- Required. Name of the model policy belongs to.
Usage:
This will produce:
-
All versions of generators with dependencies
illuminate/console Version ~5.1
illuminate/filesystem Version ~5.1
illuminate/container Version ~5.1