pintu2/routes/web.php
efbe b815d0396f
All checks were successful
Run Action to Production / run pull to sync on target message (push) Has been skipped
add spatie laravel roles
2024-03-02 18:06:48 +07:00

59 lines
2.7 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\LayananPengajuanDpuDpaController;
use App\Http\Controllers\MahasiswaController;
use App\Http\Controllers\SesiLoginController;
/*
|--------------------------------------------------------------------------
| 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!
|
*/
Route::get('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'tambah'])->name('layanan-dpudpa.tambah');
Route::post('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'store'])->name('layanan-dpudpa.store');
Route::middleware(['guest'])->group(function () {
route::get('/admin/login',[SesiLoginController::class, 'login'])->name('login');
route::post('/admin/login',[SesiLoginController::class, 'ceklogin'])->name('admin.ceklogin');
});
Route::get('/home', function(){
return redirect('/admin');
});
Route::middleware(['auth'])->group( function () {
Route::get('/admin', [AdminController::class, 'index'])->name('admin.dashboard');
Route::get('/admin/logout', [SesiLoginController::class, 'logout'])->name('admin.logout');
Route::get('/admin/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'index'])->name('layanan-dpudpa.index');
//User
Route::get('/admin/users', [UserController::class, 'index'])->name('users.index');
Route::POST('/admin/users', [UserController::class, 'store'])->name('users.store');
Route::PUT('/admin/users', [UserController::class, 'update'])->name('users.update');
Route::DELETE('/admin/users', [UserController::class, 'destroy'])->name('users.destroy');
//Mahasiswa
Route::get('/admin/mahasiswa', [MahasiswaController::class, 'index'])->name('mahasiswa.index');
Route::POST('/admin/mahasiswa', [MahasiswaController::class, 'store'])->name('mahasiswa.store');
Route::PUT('/admin/mahasiswa', [MahasiswaController::class, 'update'])->name('mahasiswa.update');
Route::DELETE('/admin/mahasiswa', [MahasiswaController::class, 'destroy'])->name('mahasiswa.destroy');
//User Roles
Route::get('/admin/users-roles', [UserController::class, 'userroles_index'])->name('users-roles.index');
Route::POST('/admin/users-roles', [UserController::class, 'userroles_store'])->name('users-roles.store');
Route::POST('/admin/users-roles/assign', [UserController::class, 'userroles_assign'])->name('users-roles.assign');
});