Skip to content

Repository files navigation

πŸ“ Laravel Weblog

A modern blog platform built with Laravel 13 and Tailwind CSS, fully RTL and in Persian, using the Vazirmatn font.

Laravel PHP Tailwind CSS Alpine.js


πŸ“‹ Table of Contents


πŸ“– About

Laravel Weblog lets users write posts, organize them into categories, and publish through an admin-approval workflow. The UI is fully Persian, RTL, and responsive.


✨ Features

# Feature Description
πŸ“° Post Management Create, edit, delete, and view posts with image upload
πŸ—‚οΈ Categories Organize and browse posts by topic
πŸ” Search Quick search across post titles and content, from the header
βœ… Admin Approval Posts by regular users require admin approval before publishing
πŸ‘οΈ View Counter Automatic view tracking per post
πŸ“„ Pagination Smart pagination on the home page, post list, and "my posts"
πŸ” Authentication Registration, login, and profile management (Laravel Breeze)
πŸ“± Responsive Design Consistent experience across desktop, tablet, and mobile
🎨 Persian RTL UI Vazirmatn font and full RTL layout across the site
🧭 Shared Header/Footer Consistent navigation, search, and quick links on every page

πŸ› οΈ Tech Stack

Layer Technology
Backend Laravel 13.8 (PHP 8.3)
Frontend Blade, Tailwind CSS 3, Alpine.js
Database MySQL (MariaDB)
Font Vazirmatn
Icons Font Awesome 6
Auth Laravel Breeze
Build Tool Vite

βš™οΈ Requirements

  • PHP >= 8.2
  • Composer
  • Node.js >= 18 and npm
  • MySQL or MariaDB (e.g. via XAMPP)

πŸš€ Installation

# 1) Clone the project
git clone https://github.com/your-username/laravel-weblog.git
cd laravel-weblog

# 2) Install PHP dependencies
composer install

# 3) Install Node dependencies
npm install

# 4) Set up environment file
cp .env.example .env
php artisan key:generate

Then edit .env with your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel-weblog
DB_USERNAME=root
DB_PASSWORD=
# 5) Run migrations
php artisan migrate

# 6) Seed default categories
php artisan db:seed --class=CategorySeeder

# 7) Create the storage symlink (for uploaded images)
php artisan storage:link

# 8) Run the app (two separate terminals)
php artisan serve
npm run dev

Visit:

http://127.0.0.1:8000

πŸ‘€ Creating an Admin User

After registering a user through the site, grant admin access via Tinker:

php artisan tinker
$u = App\Models\User::find(1);
$u->is_admin = true;
$u->save();

πŸ“ Project Structure

laravel-weblog/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Http/Controllers/
β”‚   β”‚   β”œβ”€β”€ PostController.php
β”‚   β”‚   └── CategoryController.php
β”‚   └── Models/
β”‚       β”œβ”€β”€ Post.php
β”‚       β”œβ”€β”€ Category.php
β”‚       └── User.php
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/
β”‚   └── seeders/
β”‚       └── CategorySeeder.php
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ css/app.css
β”‚   └── views/
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ site-header.blade.php
β”‚       β”‚   └── site-footer.blade.php
β”‚       β”œβ”€β”€ posts/
β”‚       β”œβ”€β”€ categories/
β”‚       β”œβ”€β”€ dashboard.blade.php
β”‚       └── welcome.blade.php
└── routes/
    └── web.php

πŸ‘₯ User Roles

Role Permissions
πŸ‘€ Guest View published posts, search, browse categories
✍️ Member Create, edit, and delete own posts (pending admin approval)
πŸ›‘οΈ Admin Approve/publish pending posts, view all posts (published and pending)

🧭 Routes

Method Path Description
GET / Home page
GET /posts List all posts + search
GET /posts/{slug} View a single post
GET /posts/create Create post form
GET /posts/{post}/edit Edit post form
POST /posts/{post}/approve Approve and publish a post (admin only)
GET /categories/{slug} Posts in a category
GET /dashboard User dashboard

⭐ Support

If you like this project, give it a star on GitHub! 🌟

About

πŸ“ Persian RTL blog built with Laravel & Tailwind CSS.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages