gegetchkori / laravel_get_enum_values
function for get enum values from migrated tables column
dev-master
2021-10-05 10:56 UTC
Requires
- php: ^7.1|^8.0
- laravel/framework: 5.7.*|5.8.*|^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2024-09-05 17:09:33 UTC
README
Helper function for get tables enum values in Laravel.
Requirements
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