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: 2024-09-05 17:09:33 UTC


README

Helper function for get tables enum values in Laravel.

License Total Downloads Monthly Downloads Daily Downloads

Laravel get enum values

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