project-ta/.history/routes/web_20260331002159.php

85 lines
3.3 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\PenghuniController;
use App\Http\Controllers\IuranController;
use App\Http\Controllers\LayananController;
/*
|--------------------------------------------------------------------------
| AUTH
|--------------------------------------------------------------------------
*/
Route::get('/', function () {
return redirect('/login');
});
// LOGIN
Route::get('/login', [AuthController::class, 'login'])->name('login');
Route::post('/login', [AuthController::class, 'prosesLogin'])->name('login.proses');
// REGISTER (USER)
Route::get('/register', [AuthController::class, 'register'])->name('register');
Route::post('/register', [AuthController::class, 'prosesRegister'])->name('register.proses');
// LOGOUT
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
/*
|--------------------------------------------------------------------------
| ADMIN
|--------------------------------------------------------------------------
*/
Route::middleware(['auth'])->prefix('admin')->group(function () {
Route::get('/dashboard', function () {
return view('admin.dashboard');
})->name('admin.dashboard');
// PENGHUNI
Route::get('/penghuni', [PenghuniController::class, 'index'])->name('penghuni.index');
Route::get('/penghuni/create', [PenghuniController::class, 'create'])->name('penghuni.create');
Route::post('/penghuni/store', [PenghuniController::class, 'store'])->name('penghuni.store');
Route::get('/penghuni/edit/{id}', [PenghuniController::class, 'edit'])->name('penghuni.edit');
Route::put('/penghuni/update/{id}', [PenghuniController::class, 'update'])->name('penghuni.update');
Route::get('/penghuni/delete/{id}', [PenghuniController::class, 'destroy'])->name('penghuni.delete');
Route::post('/rumah/store', [PenghuniController::class, 'storeRumah'])->name('rumah.store');
Route::resource('penghuni', PenghuniController::class);
Route::resource('rumah', RumahController::class);
// IURAN
Route::get('/iuran', [IuranController::class, 'index'])->name('iuran.index');
Route::get('/iuran/create', [IuranController::class, 'create'])->name('iuran.create');
Route::post('/iuran/store', [IuranController::class, 'store'])->name('iuran.store');
Route::get('/iuran/edit/{id}', [IuranController::class, 'edit'])->name('iuran.edit');
Route::put('/iuran/update/{id}', [IuranController::class, 'update'])->name('iuran.update');
Route::delete('/iuran/delete/{id}', [IuranController::class, 'destroy'])->name('iuran.delete');
// LAYANAN
Route::get('/layanan', [LayananController::class, 'index'])->name('layanan.index');
Route::post('/layanan/store', [LayananController::class, 'store'])->name('layanan.store');
Route::put('/layanan/tanggapi/{id}', [LayananController::class, 'tanggapi'])->name('layanan.tanggapi');
Route::delete('/layanan/delete/{id}', [LayananController::class, 'destroy'])->name('layanan.delete');
});
/*
|--------------------------------------------------------------------------
| USER
|--------------------------------------------------------------------------
*/
Route::middleware(['auth'])->prefix('user')->group(function () {
Route::get('/dashboard', function () {
return view('user.dashboard');
})->name('user.dashboard');
});