Download the PHP package digitalion/laravel-makes without Composer
On this page you can find all versions of the php package digitalion/laravel-makes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitalion/laravel-makes
More information about digitalion/laravel-makes
Files in digitalion/laravel-makes
Package laravel-makes
Short Description Collection of additional class creation commands for Artisan
License MIT
Homepage https://github.com/digitalion/laravel-makes
Informations about the package laravel-makes
Laravel Makes
Collection of additional class creation commands for Artisan
What It Does
This package expands on the basic artisan commands for creating classes.
Base stub
To customize the generation of Laravel classes, read the Laravel Documentation.
Installation
Require this package with composer. It is recommended to only require the package for development.
Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
Usage
Once the package is installed, you'll have additional Artisan commands:
make:class
Create a new generic class in: App\Classes\
make:enum
Create a new enum class in: App\Enums\
Enums implement the trait Digitalion\LaravelMakes\Traits\EnumSerializableTrait
that adds useful methods for using enums. View the enum methods
make:helper
Create a new helper class in: App\Helpers\
make:interface
Create a new query scope class in: App\Interfaces\
make:scope
Create a new query scope class in: App\Scopes\
make:service
Create a new query scope class in: App\Services\
make:trait
Create a new trait class in: App\Traits\
Enum methods
Get the array options
Get the array values
Get the array keys
Get the string values
This method returns a string with all the values of the enum, divided by the comma.
You may find this useful if you use it in Laravel's validation rules such as in:
.
Get the regex values
This method returns a string with regex to validate the Enum values. You may find this useful by using it in routes to accept only its values in parameters (Laravel Docs - Regular Expression Constraints).
Get the translated array
By passing the translation key prefix of the enum values, you will get an array with all the translated keys and values.
File: resources/lang/en/enums.php
Use:
License
The MIT License (MIT). Please see License File for more information.