Skip to content

Instantly share code, notes, and snippets.

@aneesdev
aneesdev / EnhancedEnum.php
Created September 19, 2022 18:59
EnhancedEnum PHP trait
<?php
trait EnhancedEnum
{
/**
* Get the enum value from the name. e.g case INVOICE = 'invoice'; will return 'invoice'
*
* @param string $name
* @return static
*/