Let's get started with Laravel

NisargNisarg
4 min read

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 ho

    • Installation 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
  • 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
  • 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.
  1. Install Composer: Download and install Composer from getcomposer.org.

  2. 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?

  1. Composer install karo.

  2. New Laravel project create karo.

  3. Development server start karo.


10
Subscribe to my newsletter

Read articles from Nisarg directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nisarg
Nisarg