## Helper class to handle native PostgreSQL Enum types inside Laravel application. ```php setDebug(true); # Create new enum type $pgEnum->addType('user_status_type', ['Active', 'Inactive']); # Explicitly Append new values to enum type $pgEnum->addValuesToType('user_status_type', ['Active', 'Inactive', 'Closed']); /** * Append or Remove values to/from type * The method is a wrapper of addValuesToType if new Values detected. * If removed values are detected it will re-create the enum with the currently provided values * When removing values, dont forget to remove the referenced values inside DB **/ $pgEnum->addType('user_status_type', ['Active', 'Inactive', 'Blocked']); # If an enum needs to be updated, but is being used by some table columns, provide the list of the affected # Tables/columns before updating it, then call the addType method $pgEnum->setTableColumns([ 'users' => ['status'], 'table2' => ['col1', 'col2'] ]); $pgEnum->addType('user_status_type', ['Active', 'Inactive']); # Get a list of all available enum types in database $typesList = $pgEnum->getCustomTypes(); # Get Available Values for an Enum type together with it's coresponding oid $defition = $pgEnum->getTypeDefinition('myType'); ``` Using inside migration: ```php use App\Lib\Helpers\PostgreEnum; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up(): void { $pgEnum = new PostgreEnum; $pgEnum->setDebug(true); $pgEnum->addType('user_status_type', ['Active', 'Inactive']); Schema::create('users', function (Blueprint $table) { ... $table->rawColumn('user_status_type', 'status'); ... }); } }