rhaarhoff / laravel-artisan-commands
Useful Artisan commands for generating services, repositories and more.
Installs: 16
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 0
Type:commands
Requires
- php: >=7
- composer/composer: ^1.6
- illuminate/console: ^5.5,<5.9
- illuminate/filesystem: ^5.5,<5.9
- illuminate/support: ^5.5,<5.9
Requires (Dev)
- illuminate/config: ^5.1,<5.9
- illuminate/view: ^5.1,<5.9
- phpunit/phpunit: 4.*
README
Description
This package provides some useful Artisan commands for generating services, repositories and more.
Installation
Require this package with Composer using the following command:
composer require rhaarhoff/laravel-artisan-commands
After updating Composer, add the service provider to the providers
array in config/app.php
:
Rhaarhoff\LaravelArtisanCommands\CommandServiceProvider::class
Run the dump-autoload
command:
composer dump-autoload
In Laravel, instead of adding the service provider in the config/app.php
file, you can add the following code to your app/Providers/AppServiceProvider.php
file, within the register()
method:
public function register() { if ($this->app->environment() !== 'production') { $this->app->register(\Rhaarhoff\LaravelArtisanCommands\CommandServiceProvider::class); } // ... }
Commands
Below you can find all the commands that you can use, including the parameters that you can specify.
COMMAND PARAMETER DESCRIPTION
-----------------------------------------------------------------------------------------------------------------------
make:service <name> Generates a basic service class
make:service <name> -m <model> Generates a basic service class as well as a model
make:service <name> -c Generates a service class with a constructor
make:service <name> -y <repository> Generates a service class as well as a repository
make:repository <name> Generates a basic repository class
make:repository <name> -m <model> Generates a repository class as well as a model
make:layer <name> Generates only a model class if no parameters are specified
make:layer <name> -c Generates a new controller class for the model
make:layer <name> -s Generates a new service class for the model
make:layer <name> -y Generates a new repository class for the model
make:layer <name> -f Generates a new factory class for the model
make:layer <name> -m Generates a new migration for the model
make:layer <name> -p Indicates if the model should be a custom intermediate table model
make:layer <name> -r Indicates if the generated controller should be a resource controller
make:layer <name> -all Generates a migration, factory, resource controller, service
and repository for the model
License
The Laravel Artisan Commands is open-sourced software licensed under the MIT license.