Laravel is a popular tool to build websites and apps. Composer helps you get Laravel ready quickly and correctly.
0
0
Laravel installation with Composer
Introduction
You want to start a new Laravel project on your computer.
You need to set up Laravel with all its parts automatically.
You want to make sure Laravel and its tools are the right versions.
You are preparing your computer to build web apps with Laravel.
Syntax
Laravel
composer create-project --prefer-dist laravel/laravel project-name
Replace project-name with your desired folder name for the Laravel app.
This command downloads Laravel and all needed files into that folder.
Examples
This creates a new Laravel project named blog.
Laravel
composer create-project --prefer-dist laravel/laravel blog
This installs Laravel version 10.x in a folder called myapp.
Laravel
composer create-project --prefer-dist laravel/laravel myapp "10.*"Sample Program
This example shows how to create a Laravel project named mysite, then start a local server to see your app in a browser.
Laravel
# Open your terminal or command prompt composer create-project --prefer-dist laravel/laravel mysite # After installation, move into the project folder cd mysite # Start the Laravel development server php artisan serve
OutputSuccess
Important Notes
Make sure you have PHP and Composer installed before running these commands.
Use php artisan serve to run your app locally after installation.
If you see permission errors, try running the command with proper rights or check your folder permissions.
Summary
Composer helps you install Laravel easily with one command.
Replace the project name to create your own app folder.
After installation, use Laravel's built-in server to start working on your app.