No description
  • PHP 55.2%
  • Blade 44.4%
  • JavaScript 0.2%
  • CSS 0.2%
Find a file
2026-07-17 02:11:23 +07:00
app fix: auth 401 JSON + menu 3-level seeder (closes #1) 2026-07-17 02:01:14 +07:00
bootstrap fix: auth 401 JSON + menu 3-level seeder (closes #1) 2026-07-17 02:01:14 +07:00
config Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
database feat: import legacy data dari dumpfile.sql 2026-07-17 02:11:23 +07:00
public Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
resources Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
routes Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
storage Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
tests Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
.editorconfig Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
.env.example Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
.gitattributes Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
.gitignore Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
artisan Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
composer.json Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
composer.lock Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
package.json Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
phpunit.xml Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00
README.md docs: tambah README.md backend 2026-07-17 01:13:54 +07:00
vite.config.js Milestone 1: Backend API Laravel 12 — Sanctum auth, migration, seeder, CRUD API, RSS feed 2026-07-17 01:04:45 +07:00

CMS Pemerintah — Backend API

Backend API untuk CMS Pemerintah berbasis Laravel 12 + PostgreSQL. Menyediakan REST API untuk dikonsumsi oleh frontend Nuxt 3.

Tech Stack

  • Laravel 12 (PHP 8.3+)
  • PostgreSQL 15
  • Laravel Sanctum (token-based auth)
  • PHPUnit (testing)

Prasyarat

  • PHP 8.3+
  • Composer
  • PostgreSQL

Instalasi

# 1. Clone repository
git clone https://git.pi.interka.my.id/CMS2026/CMS-BE.git
cd CMS-BE

# 2. Install dependencies
composer install

# 3. Setup environment
cp .env.example .env
php artisan key:generate

# 4. Konfigurasi database di .env
# DB_CONNECTION=pgsql
# DB_HOST=127.0.0.1
# DB_PORT=5432
# DB_DATABASE=cms_pemerintah
# DB_USERNAME=root
# DB_PASSWORD=admin123

# 5. Jalankan migration & seeder
php artisan migrate --seed

# 6. Jalankan server
php artisan serve --host=0.0.0.0 --port=8000

Kredensial Default

Role Username Password
Admin admin admin123
Penulis penulis penulis123

API Endpoint

Base URL: http://localhost:8000/api/v1

Publik

Method Endpoint Keterangan
GET /home Data landing page
GET /articles Listing berita (pagination, search, filter)
GET /articles/{slug} Detail berita
GET /pages/{slug} Halaman statis
GET /menus Struktur menu
GET /settings/public Setting publik
GET /links Tautan eksternal

Auth

Method Endpoint Keterangan
POST /auth/login Login, return token
POST /auth/logout Revoke token
GET /auth/me Data user login

Admin (Bearer Token)

Method Endpoint Keterangan
GET /admin/dashboard Statistik
CRUD /admin/articles Manajemen berita
CRUD /admin/galleries Manajemen galeri
CRUD /admin/categories Manajemen kategori
CRUD /admin/pages Manajemen halaman
CRUD /admin/menus Manajemen menu
CRUD /admin/users Manajemen pengguna
CRUD /admin/links Manajemen tautan
GET/PUT /admin/settings Pengaturan situs

RSS Feed

Method Endpoint Keterangan
GET /feed RSS 2.0

Testing

php artisan test

Struktur Direktori

app/
├── Http/
│   ├── Controllers/Api/   # API Controllers
│   └── Requests/          # Form Request validasi
├── Models/                # Eloquent Models
└── Policies/              # Authorization Policies

database/
├── migrations/            # Database migrations
└── seeders/               # Database seeders

routes/
├── api.php                # API routes (/api/v1)
└── web.php                # Web routes (/feed)