我正在开始一个新项目,我想用一个新版本的laravel启动它.我不想升级和旧版本.
如何创建Laravel 5.2项目?
我的问题在哪里,我做了什么:
我安装了laravel 5.1
composer create-project --prefer-dist laravel/laravel projectname
laravel new projectname也有同样的问题.
这是安装新项目后的作曲家文件
{ "name": "laravel/laravel","description": "The Laravel Framework.","keywords": ["framework","laravel"],"license": "MIT","type": "project","require": { "PHP": ">=5.5.9","laravel/framework": "5.1.*" },"require-dev": { "fzaninotto/faker": "~1.4","mockery/mockery": "0.9.*","PHPunit/PHPunit": "~4.0","PHPspec/PHPspec": "~2.1" },...
我也尝试过
composer create-project laravel/laravel=5.2.0 projectname
但我得到了这个错误
could not find package laravel/laravel with version 5.2.0.
我试过用composer自我更新同样的问题
我阅读了laravel 5.2文档.它正式出局
如果你看一下
https://stackoverflow.com/a/25949281/3593996,当Laravel 5处于开发版本时会问到同样的问题.
现在,如果你想创建5.2项目,你需要在composer create project中使用dev-develop作为版本:
composer create-project laravel/laravel your-project-name dev-develop
但是如果你想安装5.1版本,你可以使用
composer create-project laravel/laravel your-project-name 5.1.*
或简单:
composer create-project laravel/laravel your-project-name
类似于旧版本,例如:
composer create-project laravel/laravel your-project-name 5.0.*
要么
composer create-project laravel/laravel your-project-name 4.2.*
当Laravel 5.2将稳定发布时,您将能够使用它进行安装
composer create-project laravel/laravel your-project-name 5.2.*
或者简单
composer create-project laravel/laravel your-project-name
和使用
composer create-project laravel/laravel your-project-name dev-develop
您可能会安装Laravel 5.3的开发版本