13

Been following along several Laravel tutorials online and they all create a new project through either of these two commands:

laravel new project-name

or

composer create-project laravel/laravel project-name

They both seem to generate the same template, but are there any differences between the two one should know about? Laravel docs are unclear on this, and couldn't find an answer online, would appreciate if someone can clear it up for me.

1

1 Answer 1

9

composer create-project laravel/laravel project-name will do two extra things as far as I know. These are executed because of scripts in composer.json

  1. cp .env.example .env
  2. ./artisan key:generate

composer.json

Sign up to request clarification or add additional context in comments.

2 Comments

Andrew Hood, could you explain a little better what the #2 thing is?
@LeonardoSibela #2 generates application secret key and assigns it to app key field in your .env file created in step #1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.