Download the PHP package 3rd-sense/generators without Composer
On this page you can find all versions of the php package 3rd-sense/generators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3rd-sense/generators
More information about 3rd-sense/generators
Files in 3rd-sense/generators
Package generators
Short Description Laravel 5 generators.
License MIT
Informations about the package generators
3rd Sense Australia Laravel 5 Generators
Based on the excellent Generators by Jeffery Way we have added a couple more that we use regularly here at 3rd Sense.
These include:
- make:repository
- make:transformer
Replicated make commands from official repository Illuminate\Foundation for use in Lumen
- make:command
- make:console
- make:event
- make:job
- make:listener
- make:model
- make:provider
- make:test
Usage
Step 1: Install using composer
Step 2: Add the service provider
Following Jeffery's advice these should only be available in your local development environment, 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:
For Laravel config/app.php
For Lumen bootstrap/app.php
Step 3: Run artisan
generators!
You're all set. Run php artisan
from the console, and you'll see the new commands in the make:*
namespace section.
Examples
- Generate Repository Classes
- Generate Transformer Classes
For all other commands refer to the official Laravel documentation
Generate Repository Classes
This will generate 2 files for you in the app/repositories directory, the repository:
and the repository interface:
Now you just need to register these repositories with your service container. To do this just add the following snippet to your app/Providers/AppServiceProvider
's register
method:
and you're good to go.
The other alternative is to create an App/Providers/RepositoriesServiceProvider
class and place the above code in the register
method. Remember to add this new service provider to your config/app.php
providers
array.
Generate Transformer Classes
This generator is to be used to create transformers for the Fractal package provided by The PHP League
This will generate the following tranformer for you in the app/Tranformers directory:
All versions of generators with dependencies
illuminate/console Version ~5.0
illuminate/filesystem Version ~5.0
illuminate/support Version ~5.0