laravel_get_enum_values maintained by gegetchkori
Laravel get enum values
Helper function for get tables enum values in Laravel.

Requirements
| name | version |
|---|---|
php |
^7.1 or ^8.0 |
laravel |
from 5.7.* to ^8.0 |
Installation
Run this command on terminal in your project root:
composer require gegetchkori/laravel_get_enum_values
Then run this command on terminal in your project root:
php artisan vendor:publish --provider="Gegetchkori\LaravelGetEnumValues\GetEnumValuesServiceProvider"
Usage
Configure .env file, create migration, put into enum type column and run this command:
php artisan make:controller EnumValuesController
Create some function and call this method from helpers.php
public function test()
{
$enumoption = General::getEnumValues('table_name','column_name');
return $enumoption;
}
Create appropriate route in web.php
Result
Returned data type
array