Example of Enum in area17/twill

File composer.json (link to Github)
{
  //
  "require": {
    "php": "^7.1|^8.0",
    //
    "myclabs/php-enum": "^1.5"
  },
  //
}
File src/Models/Enums/UserRole.php (link to Github)
use MyCLabs\Enum\Enum;

class UserRole extends Enum
{
    const VIEWONLY = 'View only';
    const PUBLISHER = 'Publisher';
    const ADMIN = 'Admin';
}
File src/Models/User.php (link to Github)
use A17\Twill\Models\Enums\UserRole;
use Illuminate\Foundation\Auth\User as AuthenticatableContract;

class User extends AuthenticatableContract
{
    //
    public function getRoleValueAttribute()
    {
        if (!empty($this->role)) {
            if ($this->role == 'SUPERADMIN') {
                return "SUPERADMIN";
            }

            return UserRole::{$this->role}()->getValue();
        }

        return null;
    }
    //
}
File src/Http/Controllers/Admin/UserController.php (link to Github)
use A17\Twill\Models\Enums\UserRole;

class UserController extends ModuleController
{
    //
    protected function indexData($request)
    {
        return [
            'defaultFilterSlug' => 'published',
            'create' => $this->getIndexOption('create') && $this->authFactory->guard('twill_users')->user()->can('manage-users'),
            'roleList' => Collection::make(UserRole::toArray()),
            'single_primary_nav' => [
                'users' => [
                    'title' => twillTrans('twill::lang.user-management.users'),
                    'module' => true,
                ],
            ],
            'customPublishedLabel' => twillTrans('twill::lang.user-management.enabled'),
            'customDraftLabel' => twillTrans('twill::lang.user-management.disabled'),
        ];
    }
    //
}

Additional resources on enum: