Create new laravel project
To create a new Laravel project, you can use the following command in your terminal:
composer create-project --prefer-dist laravel/laravel project-name
Replace project-name
with the name you want to give your project.
This command will create a new Laravel project in a directory with the same name as the project name you specified. The project will include the basic structure and files needed to start building your application.
Here's a breakdown of the command:
composer
: This is the command-line tool for managing your dependencies with Composer.create-project
: This is the command for creating a new project.--prefer-dist
: This option tells Composer to download the project in its most optimized form, which is a compressed archive.laravel/laravel
: This is the package name for the Laravel framework.project-name
: This is the name of the project you want to create.
Once the project is created, you can navigate to the project directory and start building your application.
Here's an example of how to create a new Laravel project called "my-app":
composer create-project --prefer-dist laravel/laravel my-app
This will create a new directory called "my-app" with the basic structure and files needed to start building your application.
You can then navigate to the project directory and start building your application:
cd my-app
You can then start the development server by running the following command:
php artisan serve
This will start the development server and you can access your application by navigating to http://localhost:8000
in your web browser.
That's it! You now have a new Laravel project up and running.