This guide will walk you through installing Laravel 11 on your local machine.
Prerequisites
- Composer: Ensure you have Composer installed globally on your system. You can download and install it from getcomposer.org.
- PHP: Laravel requires a recent version of PHP. Refer to the official Laravel documentation for the minimum supported version.
- A code editor: Choose a code editor you’re comfortable with, such as Visual Studio Code, Sublime Text, or PhpStorm.
Installation Steps
- Open your terminal or command prompt.
- Navigate to the desired project directory.
- Use Composer to create a new Laravel project: Bash
composer create-project --prefer-dist laravel/laravel:^11 my-laravel-project
Replacemy-laravel-project
with your desired project name. This command will:- Download the latest Laravel 11 files.
- Install all required dependencies.
- Generate a basic Laravel project structure.
- Navigate to your project directory: Bash
cd my-laravel-project
- Generate an application key: Bash
php artisan key:generate
This generates a secure application key used for encryption and other security features. - Start the development server: Bash
php artisan serve
This starts the built-in development server, typically onhttp://127.0.0.1:8000
.
Congratulations! You have successfully installed Laravel 11. You can now start developing your application.
Key Points
- Laravel 11 (hypothetical): This guide assumes the release of Laravel 11. Replace
^11
in thecomposer create-project
command with the actual version number once available. - Project Structure: Familiarize yourself with the default Laravel project structure.
- Documentation: Refer to the official Laravel documentation for detailed information, examples, and best practices.
Note: This is a basic installation guide. Laravel offers many features and functionalities. Explore the documentation to learn more about routing, controllers, views, databases, and other aspects of the framework.