gegetchkori/laravel_get_enum_values

function for get enum values from migrated tables column

dev-master 2021-10-05 10:56 UTC

This package is auto-updated.

Last update: 2025-06-05 18:59:36 UTC


README

Helper function for get tables enum values in Laravel.

License Total Downloads Monthly Downloads Daily Downloads

Laravel get enum values

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