LessonsBuild a Blog → Part 1

Project Setup & Planning

Laravel
⏱ 20 min read🏗️ ProjectNot completed

In this series you'll build a complete blog application with Laravel from scratch — including authentication, admin panel, categories, tags, comments, search, and pagination. By the end you'll have a real deployable project.

What We're Building

Project Overview
Laravel Blog App
├── Public Side
│   ├── Homepage (latest posts)
│   ├── Single post page
│   ├── Category pages
│   ├── Search results
│   └── Comments
└── Admin Side
    ├── Login / Register
    ├── Dashboard
    ├── Posts (Create, Edit, Delete)
    ├── Categories management
    └── Comments moderation

Step 1: Create Laravel Project

Terminal
# Create new Laravel project
composer create-project laravel/laravel laravel-blog

cd laravel-blog

# Start development server
php artisan serve
# Visit: http://127.0.0.1:8000

Step 2: Configure Database

.env
APP_NAME="Laravel Blog"
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_blog
DB_USERNAME=root
DB_PASSWORD=your_password
Terminal — Create Database
# Login to MySQL
mysql -u root -p

# Create database
CREATE DATABASE laravel_blog;
EXIT;

Step 3: Install Required Packages

Terminal
# Laravel Breeze for authentication
composer require laravel/breeze --dev
php artisan breeze:install blade

# Install frontend dependencies
npm install
npm run dev

Step 4: Plan Database Structure

Database Tables
users
├── id
├── name
├── email
├── password
└── timestamps

posts
├── id
├── user_id (foreign key)
├── category_id (foreign key)
├── title
├── slug (unique)
├── excerpt
├── body
├── image
├── published (boolean)
├── published_at
└── timestamps

categories
├── id
├── name
├── slug
└── timestamps

tags
├── id
├── name
└── slug

post_tag (pivot)
├── post_id
└── tag_id

comments
├── id
├── post_id
├── user_id
├── body
├── approved (boolean)
└── timestamps

Step 5: Project Folder Structure

Structure We'll Build
app/
├── Http/Controllers/
│   ├── Admin/
│   │   ├── PostController.php
│   │   ├── CategoryController.php
│   │   └── CommentController.php
│   ├── BlogController.php
│   └── CommentController.php
└── Models/
    ├── Post.php
    ├── Category.php
    ├── Tag.php
    └── Comment.php

resources/views/
├── layouts/
│   ├── app.blade.php
│   └── admin.blade.php
├── blog/
│   ├── index.blade.php
│   └── show.blade.php
└── admin/
    ├── dashboard.blade.php
    └── posts/
        ├── index.blade.php
        ├── create.blade.php
        └── edit.blade.php
💡
Plan before you code! Understanding the full structure before writing a single line of code saves hours of refactoring later. Always design your database first.
🎯
What you'll learn in this series: Migrations, Models, Relationships, Eloquent, Blade layouts, Authentication, File uploads, Search, Pagination, and Deployment — all in one real project!
← All Lessons Next Lesson →
💡

Stuck? Need help?

Review the previous lessons or check the Laravel documentation.

Laravel Docs →