alablaster/foreman

Generator utility for Laravel Projects

v1.0.1 2022-02-21 09:50 UTC

This package is auto-updated.

Last update: 2024-09-26 16:00:24 UTC


README

PHP Composer

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,