Let's get started with Laravel


Laravel is a free and open-source PHP framework designed for building web applications following the Model-View-Controller (MVC) architectural pattern. Created by Taylor Otwell and released in 2011, Laravel has become one of the most popular PHP frameworks due to its elegant syntax and robust features .
๐ง Key Features of Laravel
1. MVC Architecture
Laravel follows the MVC pattern, which separates the application logic into three interconnected components:
Model: Handles data and business logic.
View: Manages the user interface.
Controller: Acts as an intermediary between Model and View .
2. Eloquent ORM
Laravel's built-in Object-Relational Mapping (ORM) system, Eloquent, allows developers to interact with the database using PHP syntax instead of raw SQL queries. This simplifies database operations and enhances code readability .
3. Blade Templating Engine
Blade is Laravel's powerful templating engine that enables developers to create dynamic web pages with ease. It provides features like template inheritance and data display, making the development process more efficient .
4. Artisan CLI
Artisan is Laravel's command-line interface that automates repetitive tasks such as database migrations, testing, and code generation. It streamlines development workflows and enhances productivity .
5. Routing System
Laravel's routing system allows developers to define URL patterns and associate them with specific controllers and actions. This makes it easy to handle user requests and direct them to the appropriate part of the application .
6. Security Features
Laravel offers built-in features like Cross-Site Request Forgery (CSRF) protection, encryption, and password hashing, ensuring that applications are protected against common security threats .
๐ Getting Started with Laravel
Prerequisites
Basic knowledge of PHP
PHP version โฅ 5.6.4
Composer (PHP dependency manager)
Installation Steps
โ PART 1: Installing XAMPP
๐ป English: XAMPP Installation Steps
๐ง Step 1: Download XAMPP
Visit: https://www.apachefriends.org/index.html
Choose your operating system (Windows / macOS / Linux)
Download the latest version of XAMPP (preferably with PHP 8.1 or higher)
โ๏ธ Step 2: Install XAMPP
Run the downloaded installer
Follow the setup wizard:
Select components (default is fine)
Choose install location (default
C:\xampp
is fine)Finish installation
๐ Step 3: Launch XAMPP
Open XAMPP Control Panel
Start Apache and MySQL
Open browser and go to:
http://localhost/
โ You should see the XAMPP welcome page
๐ฎ๐ณ Hinglish: XAMPP Install Karne ke Steps
๐ง Step 1: XAMPP Download Karo
Website kholo: https://www.apachefriends.org/index.html
Apne system ke liye version choose karo (Windows / macOS / Linux)
Latest version download karo (PHP 8.1 ya uske upar ho to better hai)
โ๏ธ Step 2: XAMPP Install Karo
Jo file download hui hai, usko run karo
Wizard ke steps follow karo:
Components ko default chhod do
Install location bhi default (
C:\xampp
) rakh sakte hoInstallation complete hone do
๐ Step 3: XAMPP Start Karo
XAMPP Control Panel open karo
Apache aur MySQL start karo
Browser mein jaake likho:
http://localhost/
โ XAMPP page dikhai dega
โ PART 2: Installing Composer
๐ป English: Composer Installation Steps
๐ง Step 1: Download Composer
Go to: https://getcomposer.org/download/
Download the Composer-Setup.exe for Windows
โ๏ธ Step 2: Run Composer Installer
Run the setup file
It will ask for PHP path:
- For XAMPP: Select
C:\xampp\php\php.exe
- For XAMPP: Select
Follow remaining steps and install Composer globally
โ Step 3: Verify Composer
Open Command Prompt
Run:
composer
- You should see a list of Composer commands.
๐ฎ๐ณ Hinglish: Composer Install Karne ke Steps
๐ง Step 1: Composer Download Karo
Jaao: https://getcomposer.org/download/
Composer-Setup.exe Windows ke liye download karo
โ๏ธ Step 2: Setup Run Karo
Installer ko run karo
PHP path maangega:
- Agar XAMPP use kar rahe ho to path hoga:
C:\xampp\php\php.exe
- Agar XAMPP use kar rahe ho to path hoga:
Baaki steps ko follow karo aur install complete karo
โ Step 3: Check Karo Composer Install Hua ya Nahi
Command Prompt open karo
Type karo:
composer
- Agar Composer commands dikh rahe hain to successfully install ho gaya.
Install Composer: Download and install Composer from getcomposer.org.
Create a New Laravel Project:
composer create-project laravel/laravel project-name
3. Start Development Server:
cd project-name
php artisan serve
Your application will be accessible at http://localhost:8000
.
๐ฃ๏ธ Laravel in Hinglish
Laravel kya hai?
Laravel ek PHP framework hai jo web applications banane mein madad karta hai. Iska use karke aap easily scalable aur maintainable applications develop kar sakte ho.
Laravel ke features:
MVC architecture: Code ko organize karne mein madad karta hai.
Eloquent ORM: Database operations ko simple banata hai.
Blade templating engine: Dynamic views banane mein madad karta hai.
Artisan CLI: Development tasks ko automate karta hai.
Routing system: URLs ko controllers se link karta hai.
Security features: Applications ko secure banata hai.
Shuru kaise karein?
Composer install karo.
New Laravel project create karo.
Development server start karo.
Subscribe to my newsletter
Read articles from Nisarg directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
