Skip to content

archvayu/laravel-enum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Enum Generator

Laravel Enum Generator as name suggests helps generate native php enum objects to facilitate laravel enum usage using artisan command.

Requirement

Laravel 10 php > 8.1

Installation

composer require archvayu/laravel-enum

Usage

There are basically two types of enums that can be used: pure and backed.

To generate pure enum:

php artisan make:enum EnumName --tyep=pure

To generate backed enum with integer scalar equivalent:

php artisan make:enum BackedEnum --type=backed --scalar=int

To generate backed enum with string scalar equivalent:

php artisan make:enum BackedEnum --type=backed --scalar=string

Backed Enum contains two methods to get vlaues array of scalar and array for select operations.

LICENSE

Licensed using MIT License

About

Laravel Enum Generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages