alablaster / foreman
Generator utility for Laravel Projects
Requires
- php: ^8.1
Requires (Dev)
- orchestra/testbench: ^6.24
- phpunit/phpunit: 9.5.x-dev
README
A generator utility for creating Laravel Projects
Install
To install the package in a Laravel Project run the following command.
$ composer install alablaster/foreman
Configuration
To publish the configuration file run:
$ php artisan vendor:publish --provider=="Alablaster\Foreman\ForemanServiceProvider"
In the config files you can define the base namespace. In an Laravel project this is App by default, though if you are creating a package is might be your package name, like "Alablaster\Foreman". Namespaces should be defined in studly case with for slashes.
Use
The following commands and arguments are supported by Foreman. To generate a full entity run the following command:
$ php artisan foreman:entity Model --N=Path\To\Namespace --D=Domain
Customization
After publishing the vendor files will generate a stubs
directory in the
base of the project. These templates can be modified to and used to
generate files using the Foreman commands.
In the template, passed variables can be accessed using a mustache like
sintax, for example {{ model }}
. Variables can be modified using a variety
of filters through a dot notation, for example {{ model.lowercase.plural }}.
This includes all of Laravel's Str class helpers. Additionally, it includes
leadingBackSlash
, trailingForwardSlash
, trailingDot
,