Download the PHP package laravel-enso/enums without Composer

On this page you can find all versions of the php package laravel-enso/enums. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package enums

Enums

Stable Downloads Issues Merge Requests

Description

Enums provides both legacy class-based enumerations and frontend-ready native PHP enum discovery for Laravel Enso.

The package keeps backwards compatibility with Enso's original enum classes while also scanning vendor and application Enums folders for native PHP enums that implement specific contracts. Those enums can then be registered into application state and exposed to the frontend in a normalized shape.

It is used throughout the Enso ecosystem for typed option lists, shared UI state, and enum mapping between backend code and frontend consumers.

::: warning Note Since PHP now provides native enums, we strongly recommend migrating new and existing code to native PHP enums wherever possible.

We still intend to keep supporting the Enso enum registry layer for ecosystem integration and frontend state registration, even as the legacy custom enum implementation is phased out. :::

Installation

Install the package:

The package auto-registers:

If you want to customize which vendor namespaces are scanned, publish the configuration:

If you want an application provider for registering legacy enums explicitly, publish the stub:

Default configuration:

For native frontend enums, place enum classes under your PSR-4 Enums folder. In a standard Laravel application this means app/Enums.

Features

Usage

Legacy Class-Based Enums

Extend LaravelEnso\Enums\Services\Enum:

Available helpers:

Native PHP Enums For Frontend State

Implement LaravelEnso\Enums\Contracts\Frontend on a backed enum:

The enum will be discovered from an Enums folder and registered under the key returned by registerBy().

Legacy Enum Registration

Register legacy enums through the facade or EnumServiceProvider:

API

Configuration

config/enums.php

Keys:

The scanner checks:

Service Providers

Responsibilities:

Legacy Enum Base Class

LaravelEnso\Enums\Services\Enum

Key methods:

Native Enum Discovery

Requirements for discovery:

Optional mapping:

Legacy Enum Registry

Key methods:

State Provider

LaravelEnso\Enums\State\Enums

Provides merged enum state for frontend consumption under the enums store key.

Traits

Depends On

Required Enso packages:

Framework dependency:

Companion frontend package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!


All versions of enums with dependencies

PHP Build Version
Package Version
Requires laravel-enso/core Version ^12.0
laravel-enso/helpers Version ^4.0
laravel/framework Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laravel-enso/enums contains the following files

Loading the files please wait ...