PHPackages                             raid/core-enum - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. raid/core-enum

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

raid/core-enum
==============

Raid Core Enum

047PHP

Since Feb 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MohamedKhedr700/core-enum)[ Packagist](https://packagist.org/packages/raid/core-enum)[ RSS](/packages/raid-core-enum/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Core Enum Package
=================

[](#core-enum-package)

This package is responsible for handling all enums in the system. The package using the `archtechx/enums` package as a base for the enums.

Installation
------------

[](#installation)

```
composer require raid/core-enum
```

Configuration
-------------

[](#configuration)

```
php artisan core:publish-enum
```

Usage
-----

[](#usage)

```
class PostController extends Controller
{
    /**
     * Invoke the controller method.
     */
    public function __invoke(Request $request): JsonResponse
    {
        $adminType = UserTypeEnum::ADMIN;

        $guestType = UserTypeEnum::GUEST;

        $userType = UserTypeEnum::USER;

        $userTypeConstants = UserTypeEnum::constants();

        $hasAdminConstant = UserTypeEnum::hasConstant('ADMIN');
    }
}
```

How to work this
================

[](#how-to-work-this)

Let's create our `const enum ` class and prefer classes as they ar extendable.

You can use this command to create your enum class.

```
php artisan core:make-enum UserTypeEnum
```

```
