laravel枚举类创建
大家好,我想请教一下,php的laravel是怎么使用枚举类的,百度上查询都是千篇一律的,是使用这个composer require bensampo/laravel-enum
命令来安装依赖库的,但是我使用该命令报错了
Using version ^3.0 for bensampo/laravel-enum
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for bensampo/laravel-enum ^3.0 -> satisfiable by bensampo/laravel-enum[v3.0.0].
- Conclusion: remove laravel/framework v5.7.24
- Conclusion: don't install laravel/framework v5.7.24
- bensampo/laravel-enum v3.0.0 requires illuminate/contracts ^8.0 -> satisfiable by illuminate/contracts[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.10.0, v8.11.0, v8.11.1, v8.11.2, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0, v8.9.0].
- don't install illuminate/contracts 8.x-dev|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.0.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.0.1|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.0.2|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.0.3|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.0.4|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.1.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.10.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.11.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.11.1|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.11.2|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.2.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.3.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.4.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.5.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.6.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.7.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.7.1|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.8.0|don't install laravel/framework v5.7.24
- don't install illuminate/contracts v8.9.0|don't install laravel/framework v5.7.24
- Installation request for laravel/framework (locked at v5.7.24, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.24].
Installation failed, reverting ./composer.json to its original content.
我想请教一下这个问题该怎么解决,或者说有其他的方法来创建枚举类吗?
2 Comments
版本问题啊 你本地是 5.7 却要安装一个 8.x 的包 选择一个与 laravel 5.7.* 兼容的版本安装即可 比如
感谢学院君,按照你说的问题已经解决了。