196 lines
10 KiB
PHP
196 lines
10 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\AccountController;
|
|
use App\Http\Controllers\AuthController;
|
|
use App\Http\Controllers\DashboardController;
|
|
use App\Http\Controllers\KriteriaController;
|
|
use App\Http\Controllers\LandingPageController;
|
|
use App\Http\Controllers\PengumumanController;
|
|
use App\Http\Controllers\PerbandinganController;
|
|
use App\Http\Controllers\PerbandinganSubKriteriaController;
|
|
use App\Http\Controllers\PeriodeController;
|
|
use App\Http\Controllers\ProfilDesaController;
|
|
use App\Http\Controllers\RiwayatSeleksiController;
|
|
use App\Http\Controllers\SeleksiController;
|
|
use App\Http\Controllers\SubkriteriaController;
|
|
use App\Http\Controllers\UserController;
|
|
use App\Http\Controllers\VerifikasiController;
|
|
use App\Http\Controllers\WargaController;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "web" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// mulaiiii bismillah
|
|
Route::middleware('guest')->group(function () {
|
|
Route::get('/', [LandingPageController::class, 'index'])->name('beranda');
|
|
|
|
// Proses cek bansos warga
|
|
Route::post('/cek-bansos', [LandingPageController::class, 'cekBansos'])->name('cek.bansos');
|
|
Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
|
|
Route::post('/login', [AuthController::class, 'login']);
|
|
Route::get('/register', [AuthController::class, 'showRegister']);
|
|
Route::post('/register', [AuthController::class, 'register'])->name('register');
|
|
});
|
|
|
|
// Auth: Hanya bisa diakses jika sudah login
|
|
Route::middleware('auth')->group(function () {
|
|
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
|
|
|
|
// Profil
|
|
Route::get('/profile', [AccountController::class, 'profile'])->name('account.profile');
|
|
Route::post('/profile/update', [AccountController::class, 'updateProfile'])->name('account.updateProfile');
|
|
|
|
// admin
|
|
Route::middleware('checkRole:admin')->group(function () {
|
|
|
|
// Dashboard Admin
|
|
Route::get('/admin/dashboard', [DashboardController::class, 'adminDashboard'])->name('admin.dashboard');
|
|
|
|
// Manajemen User
|
|
Route::resource('users', UserController::class);
|
|
Route::post('/users/{user}/reset-password', [UserController::class, 'resetPassword'])->name('users.reset_password');
|
|
Route::patch('/users/{user}/toggle-status', [UserController::class, 'toggleStatus'])->name('users.toggle_status');
|
|
|
|
// Pengaturan Akun & PIN
|
|
Route::get('/account/settings', [AccountController::class, 'settings'])->name('account.settings');
|
|
Route::post('/account/update-pin', [AccountController::class, 'updatePin'])->name('account.updatePin');
|
|
|
|
// Periode
|
|
Route::resource('periode', PeriodeController::class);
|
|
Route::post('periode/{id}/aktifkan', [PeriodeController::class, 'aktifkan'])->name('periode.aktifkan');
|
|
|
|
// Kriteria
|
|
Route::get('/kriteria', [KriteriaController::class, 'index'])->name('kriteria.index');
|
|
Route::get('/kriteria/create', [KriteriaController::class, 'create'])->name('kriteria.create');
|
|
Route::post('/kriteria', [KriteriaController::class, 'store'])->name('kriteria.store');
|
|
Route::get('/kriteria/{id}/edit', [KriteriaController::class, 'edit'])->name('kriteria.edit');
|
|
Route::put('/kriteria/{id}', [KriteriaController::class, 'update'])->name('kriteria.update');
|
|
Route::delete('/kriteria/{id}', [KriteriaController::class, 'destroy'])->name('kriteria.destroy');
|
|
|
|
// Sub-Kriteria
|
|
Route::resource('subkriteria', SubkriteriaController::class);
|
|
Route::get('subkriteria/get-by-kriteria/{kriteria_id}', [SubkriteriaController::class, 'getByKriteria']);
|
|
|
|
// Kelola Warga (Fitur Khusus Admin)
|
|
|
|
Route::get('/warga/download-template', [WargaController::class, 'downloadTemplate'])->name('warga.download_template');
|
|
Route::post('/warga/import', [WargaController::class, 'importExcel'])->name('warga.import');
|
|
Route::get('warga/export', [WargaController::class, 'exportExcel'])->name('warga.export');
|
|
Route::post('/warga/bulk-update', [WargaController::class, 'bulkUpdate'])->name('warga.bulk-update');
|
|
Route::delete('/warga/bulk-delete', [WargaController::class, 'bulkDelete'])->name('warga.bulk-delete');
|
|
Route::resource('warga', WargaController::class)->except(['index', 'show']);
|
|
|
|
// Perbandingan Fuzzy AHP (Kriteria)
|
|
Route::get('/perbandingan', [PerbandinganController::class, 'index'])->name('perbandingan.index');
|
|
Route::post('/perbandingan/hitung', [PerbandinganController::class, 'hitung'])->name('perbandingan.hitung');
|
|
Route::get('/perbandingan/detail', [PerbandinganController::class, 'detail'])->name('perbandingan.detail');
|
|
Route::post('/perhitungan/hapus-pakar', [PerbandinganController::class, 'hapusPakar'])->name('perbandingan.hapus_pakar');
|
|
|
|
// Perbandingan Fuzzy AHP (Sub-Kriteria)
|
|
Route::prefix('perbandingan-sub')->group(function () {
|
|
Route::get('/', [PerbandinganSubKriteriaController::class, 'index'])->name('perbandingansub.index');
|
|
Route::post('/simpan', [PerbandinganSubKriteriaController::class, 'simpan'])->name('perbandingansub.simpan');
|
|
Route::post('/hapus-pakar', [PerbandinganSubKriteriaController::class, 'hapusPakar'])->name('perbandingansub.hapus_pakar');
|
|
Route::get('/detail', [PerbandinganSubKriteriaController::class, 'detail'])->name('perbandingansub.detail');
|
|
});
|
|
|
|
// Proses Seleksi
|
|
Route::post('/seleksi/proses', [SeleksiController::class, 'prosesHitung'])->name('seleksi.proses');
|
|
|
|
// Konten
|
|
Route::get('/pengumuman', [PengumumanController::class, 'index'])->name('pengumuman.index');
|
|
Route::get('/pengumuman/create', [PengumumanController::class, 'create'])->name('pengumuman.create');
|
|
Route::post('/pengumuman', [PengumumanController::class, 'store'])->name('pengumuman.store');
|
|
Route::get('/pengumuman/{id}/edit', [PengumumanController::class, 'edit'])->name('pengumuman.edit');
|
|
Route::put('/pengumuman/{id}', [PengumumanController::class, 'update'])->name('pengumuman.update');
|
|
Route::delete('/pengumuman/{id}', [PengumumanController::class, 'destroy'])->name('pengumuman.destroy');
|
|
|
|
// Profil Desa
|
|
Route::get('/profil-desa', [ProfilDesaController::class, 'index'])->name('profil_desa.index');
|
|
Route::get('/profil-desa/create', [ProfilDesaController::class, 'create'])->name('profil_desa.create');
|
|
Route::post('/profil-desa', [ProfilDesaController::class, 'store'])->name('profil_desa.store');
|
|
Route::get('/profil-desa/{id}/edit', [ProfilDesaController::class, 'edit'])->name('profil_desa.edit');
|
|
Route::put('/profil-desa/{id}', [ProfilDesaController::class, 'update'])->name('profil_desa.update');
|
|
Route::delete('/profil-desa/{id}', [ProfilDesaController::class, 'destroy'])->name('profil_desa.destroy');
|
|
|
|
// Utility (Opsional)
|
|
Route::get('/setup-storage', function () {
|
|
Artisan::call('storage:link');
|
|
return 'Storage berhasil dilink!';
|
|
});
|
|
Route::get('/clear-cache', function() {
|
|
Artisan::call('optimize:clear');
|
|
return 'Cache dibersihkan!';
|
|
});
|
|
});
|
|
|
|
//verifikator
|
|
Route::middleware('checkRole:verifikator')->group(function () {
|
|
Route::get('/verifikator/dashboard', [DashboardController::class, 'verifikatorDashboard'])->name('verifikator.dashboard');
|
|
|
|
// Rute Verifikasi (Hanya bisa diakses Verifikator)
|
|
Route::get('/verifikasi', [VerifikasiController::class, 'verifikasiIndex'])->name('verifikasi.index');
|
|
Route::get('/verifikasi/{id}', [VerifikasiController::class, 'verifikasiShow'])->name('verifikasi.show');
|
|
Route::post('/verifikasi/{id}/proses', [VerifikasiController::class, 'verifikasiProses'])->name('verifikasi.proses');
|
|
Route::post('/verifikasi/massal', [VerifikasiController::class, 'verifikasiMassal'])->name('verifikasi.massal');
|
|
});
|
|
|
|
//akses admin dan verifikator
|
|
Route::middleware('checkRole:admin,verifikator')->group(function () {
|
|
|
|
// Data Warga (Hanya Index dan Show)
|
|
Route::resource('warga', WargaController::class)->only(['index', 'show']);
|
|
|
|
// Hasil Seleksi & Monitoring
|
|
Route::get('/seleksi', [SeleksiController::class, 'index'])->name('seleksi.index');
|
|
Route::get('/seleksi/cetak', [SeleksiController::class, 'cetak'])->name('seleksi.cetak');
|
|
Route::get('/seleksi/detail/{id}', [SeleksiController::class, 'show'])->name('seleksi.show');
|
|
Route::get('/seleksi/export-excel', [SeleksiController::class, 'exportExcel'])->name('seleksi.exportExcel');
|
|
Route::get('/seleksi/export-pdf', [SeleksiController::class, 'exportPdf'])->name('seleksi.exportPdf');
|
|
|
|
// Riwayat Seleksi
|
|
Route::get('/riwayat-seleksi', [RiwayatSeleksiController::class, 'index'])->name('riwayat.index');
|
|
// Route::get('/riwayat-seleksi/{periode_id}', [RiwayatSeleksiController::class, 'show'])->name('riwayat.show');
|
|
Route::get('/riwayat-seleksi/export-excel', [RiwayatSeleksiController::class, 'exportExcel'])->name('riwayat.exportExcel');
|
|
Route::get('/riwayat-seleksi/export-pdf', [RiwayatSeleksiController::class, 'exportPdf'])->name('riwayat.exportPdf');
|
|
});
|
|
});
|
|
|
|
// end
|
|
|
|
// Route sementara untuk menjalankan perintah terminal dari browser
|
|
Route::get('/setup-storage', function () {
|
|
\Illuminate\Support\Facades\Artisan::call('storage:link');
|
|
return 'Storage berhasil dilink! Silakan hapus route ini untuk keamanan.';
|
|
});
|
|
|
|
Route::get('/clear-cache', function() {
|
|
Artisan::call('optimize:clear');
|
|
return 'Cache berhasil dibersihkan! Silakan kembali ke halaman utama.';
|
|
});
|
|
|
|
|
|
// Route sementara untuk menjalankan perintah terminal dari browser
|
|
Route::get('/setup-storage', function () {
|
|
\Illuminate\Support\Facades\Artisan::call('storage:link');
|
|
return 'Storage berhasil dilink! Silakan hapus route ini untuk keamanan.';
|
|
});
|
|
|
|
Route::get('/clear-cache', function() {
|
|
Artisan::call('optimize:clear');
|
|
return 'Cache berhasil dibersihkan! Silakan kembali ke halaman utama.';
|
|
});
|