Creating Your First Laravel Project: A Deep Dive into Folder Structure in Hindi
Автор: Minkuweb
Загружено: 2025-03-30
Просмотров: 31
Описание:
In this video, we'll explore how to create and run a Laravel project. We'll also dive into the folder structure and explain the purpose of each file and directory.
1. Creating a New Laravel Project
To start, you need to have Composer installed. Open your terminal and run the following command to create a new Laravel project:
bash
Copy
composer create-project --prefer-dist laravel/laravel myproject
This command will create a new folder named myproject containing a fresh Laravel installation.
2. Running the Project
Once the project is created, navigate into the project directory:
bash
Copy
cd myproject
To run the Laravel development server, use the command:
bash
Copy
php artisan serve
This will start the server at http://localhost:8000, where you can access your application.
3. Understanding the Folder Structure
Now let's take a closer look at the folder structure:
app/: This folder contains the core code of your application. Inside, you’ll find:
Http/: Contains controllers, middleware, and requests.
Models/: Where your Eloquent models reside.
bootstrap/: Contains the files needed for bootstrapping the application. The cache/ directory is important for performance.
config/: Holds all configuration files for your application.
database/: Contains migrations, model factories, and seeders for database management.
public/: The entry point for your application. This directory contains the index.php file and assets like CSS and JavaScript.
resources/: Contains views, raw assets (like LESS or SASS files), and language files.
routes/: Defines all the routes for your application in the web.php and api.php files.
storage/: Where logs, compiled views, and other files are stored.
tests/: Contains automated tests for your application.In this video, we'll explore how to create and run a Laravel project. We'll also dive into the folder structure and explain the purpose of each file and directory.
1. Creating a New Laravel Project
To start, you need to have Composer installed. Open your terminal and run the following command to create a new Laravel project:
bash
Copy
composer create-project --prefer-dist laravel/laravel myproject
This command will create a new folder named myproject containing a fresh Laravel installation.
2. Running the Project
Once the project is created, navigate into the project directory:
bash
Copy
cd myproject
To run the Laravel development server, use the command:
bash
Copy
php artisan serve
This will start the server at http://localhost:8000, where you can access your application.
3. Understanding the Folder Structure
Now let's take a closer look at the folder structure:
app/: This folder contains the core code of your application. Inside, you’ll find:
Http/: Contains controllers, middleware, and requests.
Models/: Where your Eloquent models reside.
bootstrap/: Contains the files needed for bootstrapping the application. The cache/ directory is important for performance.
config/: Holds all configuration files for your application.
database/: Contains migrations, model factories, and seeders for database management.
public/: The entry point for your application. This directory contains the index.php file and assets like CSS and JavaScript.
resources/: Contains views, raw assets (like LESS or SASS files), and language files.
routes/: Defines all the routes for your application in the web.php and api.php files.
storage/: Where logs, compiled views, and other files are stored.
tests/: Contains automated tests for your application.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: