Skip to main content

Command Palette

Search for a command to run...

laravel set up

Published
2 min read
laravel set up
B

"Passionate web developer specializing in PHP, Laravel, and Filament, dedicated to building elegant, efficient, and scalable web solutions. Experienced in deploying projects and exploring new technologies to bring ideas to life."

How to Install a Laravel Project (Step-by-Step Guide)

Laravel is one of the most popular PHP frameworks for building modern web applications. In this guide, we’ll walk through the process of installing a fresh Laravel project, from setting up the environment to running your first application.


1. Environment Setup

Before installing Laravel, we need PHP, Composer, and the Laravel installer. If you already have these installed, you can skip this step.

Install PHP and Composer

  • Mac Users
    Run the following command in your terminal:

      /bin/bash -c "$(curl -fsSL https://php.new/install/mac/8.4)"
    
  • Windows Users
    Run PowerShell as Administrator and execute:

      Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows/8.4'))
    
  • Linux Users
    Run the following command in your terminal:

      /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"
    

2. Install the Laravel Installer

Once PHP and Composer are ready, install the Laravel installer globally using Composer:

composer global require laravel/installer

Make sure Composer’s global bin directory is in your system’s PATH so that the laravel command is recognized.


3. Create a New Laravel Project

You can now create a new Laravel project by running:

laravel new create-project

This will generate a fresh Laravel application inside the create-project folder.


4. Run the Laravel Project

Navigate to your project directory and start the local development server with:

php artisan serve

Your application will now be accessible at:

http://127.0.0.1:8000

5. Connect to a Database

Most Laravel applications use a database. To configure the connection:

  1. Open the .env file in the root of your Laravel project.

  2. Update the following values with your database details:

     DB_CONNECTION=mysql
     DB_HOST=127.0.0.1
     DB_PORT=3306
     DB_DATABASE=your_database_name
     DB_USERNAME=your_username
     DB_PASSWORD=your_password
    
  3. Run migrations to set up the default Laravel tables:

     php artisan migrate
    

More from this blog

🔧 Laravel Tinker দিয়ে লোকাল প্রজেক্টে পাসওয়ার্ড রিসেট করার সহজ গাইড

অনেক সময় লোকাল Laravel প্রজেক্টে কাজ করতে গিয়ে আমরা লগইন পাসওয়ার্ড ভুলে যাই। কিন্তু চিন্তার কিছু নেই — Laravel Tinker ব্যবহার করে খুব সহজেই পাসওয়ার্ড রিসেট করা যায়। এই আর্টিকেলে ধাপে ধাপে দেখানো হলো, একদম নতুনরাও যেন বুঝতে পারে। 🖥️ Tinker কী? ...

Jan 29, 20262 min read

Laravel Database Migration: নতুন কলাম যোগ ও পরিবর্তন করার সহজ গাইড (Beginner Friendly)

Laravel ব্যবহার করতে গেলে এক সময় অবশ্যই ডাটাবেজ টেবিলে নতুন কলাম যোগ করা বা পুরোনো কলাম পরিবর্তন করার প্রয়োজন পড়ে। অনেকে এই কাজ phpMyAdmin দিয়ে হাতে করে করেন।কিন্তু Laravel-এ আছে আরও সুন্দর এবং নিরাপদ পদ্ধতি — Migration। এই আর্টিকেলে আপনি শিখবেন:...

Jan 21, 20262 min read

🚀 বস, VPS এ ফাইল আপলোড করতে গিয়ে মাথা খারাপ! ইমেজ চলে, PDF কেন Fail? (Solving a Real Dev Headache)

আরে ভাই, শুনবি? আমার রিসেন্ট প্রোজেক্ট, নিয়ে একটা সেইম প্রবলেমে ফেঁসেছিলাম। ইউজাররা এখানে Image আর PDF ফাইল আপলোড করবে। লোকাল মেশিনে (Dev Environment) তো ফাটাফাটি চলছিল! কিন্তু যেই না VPS এ লাইভ করতে গেলাম... কেল্লা ফতে! সিনেমাটা ছিল এরকম: ✅ ইমেজ (J...

Dec 1, 20252 min read

🎥 সহজে MySQL SQL ফাইল ইম্পোর্ট করার পদ্ধতি

Laravel প্রজেক্টে বা অন্য যেকোনো ওয়েব অ্যাপে ডাটাবেস সেটআপ করতে হলে SQL ফাইল ইম্পোর্ট করা একটি গুরুত্বপূর্ণ ধাপ। আজকে দেখাবো কিভাবে সহজভাবে কমান্ড লাইন ব্যবহার করে SQL ফাইল ইম্পোর্ট করবেন। 1️⃣ প্রয়োজনীয় জিনিস Laragon বা XAMPP ইনস্টল করা থাকতে হবে...

Dec 1, 20252 min read

Untitled Publication

11 posts