67 lines
3.2 KiB
PHP
67 lines
3.2 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\ProfileController;
|
|
use App\Http\Controllers\DashboardController;
|
|
use App\Http\Controllers\GestureController;
|
|
use App\Http\Controllers\TranslateController;
|
|
use App\Http\Controllers\HistoryController;
|
|
use App\Http\Controllers\AdminController; // Pastikan controller ini di-import
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// 1. Landing Page Utama
|
|
Route::get('/', function () {
|
|
return view('landing');
|
|
})->name('landing');
|
|
|
|
// 2. Proteksi Halaman Harus Login
|
|
Route::middleware('auth')->group(function () {
|
|
|
|
// Dashboard Pengguna Biasa
|
|
Route::get('/dashboard', [DashboardController::class, 'userIndex'])->name('dashboard');
|
|
|
|
// Contoh Gesture A-Z (Edukasi)
|
|
Route::get('/contoh-gesture', [GestureController::class, 'userIndex'])->name('gesture.index');
|
|
|
|
// Fitur Utama: Kamera Penerjemah & Simpan Hasil
|
|
Route::get('/penerjemah', [TranslateController::class, 'index'])->name('translate.index');
|
|
Route::post('/penerjemah/simpan', [HistoryController::class, 'store'])->name('translate.store');
|
|
|
|
// Riwayat Terjemahan Pribadi
|
|
Route::get('/riwayat', [HistoryController::class, 'userIndex'])->name('history.index');
|
|
|
|
// Pengaturan Profil Akun
|
|
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
|
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
|
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
|
|
|
// ================= KHUSUS ADMIN =================
|
|
Route::middleware(['auth', 'admin'])->prefix('admin')->name('admin.')->group(function () {
|
|
|
|
// --- RUTE GESTURE ---
|
|
Route::get('/gesture', [GestureController::class, 'index'])->name('gesture');
|
|
Route::get('/gesture/create', [GestureController::class, 'create'])->name('gesture.create');
|
|
Route::post('/gesture', [GestureController::class, 'store'])->name('gesture.store');
|
|
Route::get('/gesture/{id}/edit', [GestureController::class, 'edit'])->name('gesture.edit');
|
|
Route::put('/gesture/{id}', [GestureController::class, 'update'])->name('gesture.update');
|
|
Route::delete('/gesture/{id}', [GestureController::class, 'destroy'])->name('gesture.destroy');
|
|
|
|
// --- RUTE RIWAYAT ---
|
|
Route::get('/riwayat-pengguna', [HistoryController::class, 'adminIndex'])->name('history.admin');
|
|
|
|
// --- RUTE USER ---
|
|
Route::get('/users', [AdminController::class, 'users'])->name('users');
|
|
|
|
// --- RUTE KOMUNITAS ---
|
|
Route::get('/community', [AdminController::class, 'community'])->name('community');
|
|
Route::get('/community/create', [AdminController::class, 'createCommunity'])->name('community.create');
|
|
Route::post('/community/store', [AdminController::class, 'storeCommunity'])->name('community.store');
|
|
Route::delete('/community/{id}', [AdminController::class, 'destroyCommunity'])->name('community.destroy');
|
|
|
|
// --- RUTE SOSIAL MEDIA ---
|
|
Route::get('/social/create', [AdminController::class, 'createSocial'])->name('social.create');
|
|
Route::post('/social/store', [AdminController::class, 'storeSocial'])->name('social.store');
|
|
Route::delete('/social/{id}', [AdminController::class, 'destroySocial'])->name('social.destroy');
|
|
});
|
|
});
|
|
|
|
require __DIR__.'/auth.php'; |