How To Use Composer To Create Project Using Laravel

admin_img Posted By Bajarangi soft , Posted On 23-09-2020

The Laravel framework has a few system requirements. All of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.

How to Use Composer To Create Project In Laravel

1. install xampp 

2. install laravel from the command prompt by using the command line which is given below

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


3.if we want create project in specified directory  first we need to create directory and we run below command
composer create-project laravel/laravel your-project-name –-prefer-dist


4.if we want specified version project run below command .
composer create-project laravel/laravel your-project-name 5.8.*


5. use PHP's built-in development server, you may use the serve Artisan command:

php artisan serve


By default the HTTP-server will listen to port 8000. However if that port is already in use or you wish to serve multiple applications this way, you might want to specify what port to use. Just add the --port argument:

php artisan serve --port=8080
 


Make sure to place Composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:

macOS: $HOME/.composer/vendor/bin
Windows: %USERPROFILE%\AppData\Roaming\Composer\vendor\bin
GNU / Linux Distributions: $HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin


You could also find the composer's global installation path by running composer global about and looking up from the first line.


Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed:

laravel new blog

Related Post