Skip to content

devvspl/blog_platform

Repository files navigation

Laravel 12 Blog Platform – Setup Guide

A Laravel 12-based blog platform powered by Sanctum, Livewire, and Flux.


📋 Prerequisites

Make sure the following are installed on your system:

  • PHP >= 8.1
  • Composer
  • MySQL
  • Node.js & NPM
  • Laravel 12

🚀 Installation Steps

1. Clone the Repository

git clone https://github.com/devvspl/blog_platform.git
cd blog_platform

2. Install PHP Dependencies

composer install

3. Setup Environment

Copy the example environment file:

cp .env.example .env

Update .env with your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blog_platform
DB_USERNAME=root
DB_PASSWORD=root

Set cache driver to use the database:

CACHE_DRIVER=database

4. Generate Application Key

php artisan key:generate

5. Run Migrations

Run all migrations:

php artisan migrate

Create the cache table:

php artisan cache:table
php artisan migrate

6. Seed the Database

php artisan db:seed

7. Install Laravel Sanctum

composer require laravel/sanctum

Publish Sanctum configuration and run migrations:

php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan migrate

Add Sanctum middleware to app/Http/Kernel.php under the api group:

'api' => [
    \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
    'throttle:api',
    \Illuminate\Routing\Middleware\SubstituteBindings::class,
],

8. Install and Build Frontend Dependencies

Install frontend packages:

npm install

Build assets for production:

npm run build

Or run in development mode:

npm run dev

9. Install Livewire and Flux

composer require livewire/livewire
composer require livewire/flux

Publish Livewire config:

php artisan livewire:publish

10. Start Laravel Development Server

php artisan serve

📡 API Documentation

You can find detailed API documentation on Postman:
📄 Postman API Docs


♻️ Clearing Cache

php artisan cache:clear

🛠️ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


📄 License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages