Download the PHP package davidngugi/laravel-php-generator without Composer
On this page you can find all versions of the php package davidngugi/laravel-php-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidngugi/laravel-php-generator
More information about davidngugi/laravel-php-generator
Files in davidngugi/laravel-php-generator
Package laravel-php-generator
Short Description Command line tool to generate your classes, interfaces and traits. Aiming for your higher productivity
License MIT
Informations about the package laravel-php-generator
Laravel PHP Generator
A simple command line tool to generate your Laravel classes, interfaces and traits. Aiming for your higher productivity
Installation
Documentation
The package allows you to generate Classes, Interfaces and Traits. You can generate classes that extend another class and implements an interface. The package generates the necessary directories as specified by the -p or path option. Otherwise there is a default path used.
All paths lead to the App directory. So don't have App in you path.
The following subsections explain further how to use the various commands
NOTE: Replace the string in curly braces with your own values
Create a class
Example
this generates the following
Including the path. E.g Logic/Core
You can generate multiple classes at a go
Create and Extend a class
We use the -e or --extend option. Specify the name of the class to extend. The class to extend will also be generated if it doesn't exist. You can only extend one class
Example
this generates the following 2 files:
Generate a class and Implement an Interface
We use the -i or --interface option. Specify the name of the interface to implement.
NOTE: The interface name should be without the word 'Interface' at the end, this will be auto-generated . You can only implement one interface
Example:
this will generate the following 2 files:
An interface
and a class
Create and Extend a class and Implement an Interface
We use the above options (-e and -i).
Example
this generates
NOTE: No existing files or folders will be overwritten by these commands
Create an Interface
We use the generate:interface artisan command. This also supports the -p or --path option to specify the directory path.
App\Logic\Interfaces is the default path
Example
this generates the following
Create a Trait
We use the generate:trait artisan command. This also supports the -p or --path option to specify the directory path.
App\Logic\Traits is the default path
Example
this generates the following
Contribution
All contributions (big or small) are highly welcomed. Send a PR
Authors
- David Ngugi [email protected]
Support
If you would love to support the continuous development and maintenance of this package, please consider buying me a coffee.
License
This package is open-sourced software licensed under the MIT Licence