Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Framework - Difference between creating a new project via laravel or composer?

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.

like image 774
ifma Avatar asked Aug 08 '15 02:08

ifma


People also ask

Can Laravel project run without composer?

You cannot install laravel local without composer in your project.

Why is composer needed for Laravel?

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you(refer link. It helps us installing/updating various requirements/components for our app such as Laravel framework, Doctrine, lodash etc..

How to create a new project in Laravel 5?

In laravel 5, We can create a new project using laravel create blog or using composer create-project --prefer-dist laravel/laravel blog. Is there any difference between these commands?

What is the difference between Laravel/Laravel and Laravel/framework?

laravel/laravel is the part of the app that you work with yourself (controllers, config, routes.php, resources, database, etc.) while laravel/framework is the "core" of Laravel, stuff that you don't change. Laravel/Laravel is the application template/skeleton, and is the starting point for Laravel 4 apps.

How to create a Laravel application from a PHP file?

Open The Command Prompt, and follow the commands: It will create a laravel project with a folder name “ example-app”. Then go to the correct directory. and run the last command. The “php artisan serve’ command is used for running the project on localhost.

How do I download and install Laravel on composer?

composer create-project laravel/laravel your-project-name 4.2.*. This command will download and install a fresh copy of Laravel in a new your-project-name folder within your current directory. If you prefer, you can alternatively download a copy of the Laravel repository from GitHub manually.


1 Answers

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

like image 135
Andrew Hood Avatar answered Nov 09 '22 23:11

Andrew Hood