9

I'm starting a new project and i want to start it with a new version of laravel. I don't want to upgrade and old version.

How can I create a Laravel 5.2 project?

Where is my problem and what did I do:

I installed laravel 5.1 with

composer create-project --prefer-dist laravel/laravel projectname

also laravel new projectname has the same problem.

This is the composer file after installing a fresh project

{
    "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"
    },
...

I also tried with

composer create-project laravel/laravel=5.2.0 projectname

but i got this error

could not find package laravel/laravel with version 5.2.0.

I tried with composer self-update same problem I read laravel 5.2 documentation. It is officially out

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
Adnan
  • 7,825
  • 3
  • 23
  • 41

5 Answers5

18

If you look at https://stackoverflow.com/a/25949281/3593996 the same question was asked when Laravel 5 was in develop version.

Now if you want to create 5.2 project you need to use dev-develop as version in composer create project:

composer create-project laravel/laravel your-project-name dev-develop

But if you want to install 5.1 version you can use

composer create-project laravel/laravel your-project-name 5.1.*

or simple:

composer create-project laravel/laravel your-project-name

Similar is for older versions, for example:

composer create-project laravel/laravel your-project-name 5.0.*

or

composer create-project laravel/laravel your-project-name 4.2.*

When Laravel 5.2 will be released as stable, you will be able to install it using

composer create-project laravel/laravel your-project-name 5.2.*

or simple

composer create-project laravel/laravel your-project-name

and using

composer create-project laravel/laravel your-project-name dev-develop

you will probably install development version of Laravel 5.3

Community
  • 1
  • 1
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
5

The Laravel 5.2 docs have the correct solution here:

composer create-project --prefer-dist laravel/laravel blog "5.2.*"
sevenpointsix
  • 394
  • 5
  • 4
2

Note that Laravel 5.2.0 is still a beta version, not a stable version. So, for the fresh install:

composer create-project laravel/laravel your-project-name dev-develop

enter image description here

Doan Tran
  • 656
  • 6
  • 12
1

Today if you do the usual install it gets you 5.2.23

composer create-project laravel/laravel projectname --prefer-dist
Eric Kaburu
  • 59
  • 10
1

the same happened to me. As my php version was lower than 5.5, the composer automatically downloaded the laravel version that was compatible to my php version and it was laravel 5.0.16. After installing php 5.5 it worked.

md asif rahman
  • 389
  • 3
  • 9