Download the PHP package tomeet/laravel-enum without Composer

On this page you can find all versions of the php package tomeet/laravel-enum. 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 laravel-enum

laravel-enum

A simple and easy-to-use enumeration extension package to help you manage enumerations in your project more conveniently, supporting Laravel and Lumen.

  • 一个简单好用的枚举扩展包,帮助你更方便地管理项目中的枚举,支持 Laravel 和 Lumen。

Test StyleCI Latest Stable Version Total Downloads Monthly Downloads Latest Unstable Version License

介绍

概览

安装

支持 Laravel 8/Lumen 8 以上版本:

配置项说明

Laravel

Lumen

常规使用

枚举转换和校验

这一部分通过一个需求场景来描述:用户登录 API 需要校验传入的 identity_type 是否合法,并且根据不同的值调用不同的登录逻辑。

说明:

Model 中的枚举转换

为了实现上面的多账号类型登录,account 数据表中就需要有字段 identity_type 来描述账号类型。

Laravel 的 Eloquent\Model 提供了 $casts 特性,可以将查询出来的数据字段转换成指定类型。这里也可以利用这个特性,将 account 表中的 identity_type 转换成 IdentityTypeEnum 实例。

缓存枚举

为了提高应用性能,在应用中使用缓存是很常见的一种做法。但随着业务到达一定规模后,分散在各处的缓存使用,由于定义缓存 key 的方式不统一,缓存生效时间的不确定性,都会使后期缓存的维护变得困难。

特别说明

laravel-enum 在下面2 个 package 功能的基础上,扩展增加了松散的(不区分大小写和数据类型) Request 参数转枚举实例,并内置提供了 HttpStatusCodeEnum 和 CacheEnum 等实用枚举集合。

License

MIT


All versions of laravel-enum with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
tomeet/helpers Version ^1.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 tomeet/laravel-enum contains the following files

Loading the files please wait ....