Skip to content

Instantly share code, notes, and snippets.

@richardDobron
Created July 14, 2022 15:31
Show Gist options
  • Save richardDobron/3df1b1f099bea100f6585c74d76f10c6 to your computer and use it in GitHub Desktop.
Save richardDobron/3df1b1f099bea100f6585c74d76f10c6 to your computer and use it in GitHub Desktop.

Revisions

  1. richardDobron created this gist Jul 14, 2022.
    31 changes: 31 additions & 0 deletions UserRoleTypes.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    <?php
    /**
    * This file is generated. Do not modify it manually!
    *
    * This file was generated by:
    * php artisan make:enum App\Models\UserRoleTypes --model=UserRole --id=Id --slug=Slug --title=Role
    * If there is a newer version, run:
    * php artisan make:enum App\Models\UserRoleTypes --model=UserRole --id=Id --slug=Slug --title=Role --force
    */

    namespace App\Enums;

    class UserRoleTypes
    {
    public const MANAGER = 1;
    public const CONTENT_CREATOR = 2;
    public const MODERATOR = 3;
    public const ADVERTISER = 4;
    public const INSIGHTS_ANALYST = 5;

    public static function map(): array
    {
    return [
    static::MANAGER => 'Admin',
    static::CONTENT_CREATOR => 'Editor',
    static::MODERATOR => 'Moderator',
    static::ADVERTISER => 'Advertiser',
    static::INSIGHTS_ANALYST => 'Analyst',
    ];
    }
    }