Download the PHP package mckenziearts/laravel-command without Composer
On this page you can find all versions of the php package mckenziearts/laravel-command. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mckenziearts/laravel-command
More information about mckenziearts/laravel-command
Files in mckenziearts/laravel-command
Package laravel-command
Short Description A simple Laravel package to provide artisan new commands
License MIT
Homepage https://github.com/Mckenziearts/laravel-command
Informations about the package laravel-command
Laravel-command
Simple package to quickly generate Laravel templated Repository, Helpers and Observer files.
Install
Via Composer
For Laravel 5.5 - you're done.
For Laravel 5.4 or 5.3 you'll only want to use these commands for development, so you don't want to update the providers array in . Instead, add the provider in , like so:
Usage
By default Laravel does not allow to generate observers or even does not allow to take the notion of repository as Symfony. To generate its elements you can use the following commands
Open the console and enter this command to generate a new repository :
The generate file look like this :
By default Repository load Model in the default application namespace App\Models
If your models are in another namespace, it will be necessary to change the use in the repository to have no error like :
This is the same action to perform for the observers, it also loads the models in the namespace App\Models. To generate an observer, you must execute the command:
The generate file look like this :
- Helper files
The generate file look like this :
If you need better distribut your code, you can create a helper to put a logic to lighten your controllers.
An example of a helper that I often use in my projects
Change log
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT).