No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

web.php 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. use App\Http\Controllers\AdminController;
  3. use App\Http\Controllers\ApresiasiController;
  4. use App\Http\Controllers\DashboardController;
  5. use App\Http\Controllers\InformasiController;
  6. use App\Http\Controllers\PanduanController;
  7. use App\Http\Controllers\PelaporanController;
  8. use App\Http\Controllers\ProfileController;
  9. use App\Http\Controllers\RiwayatLaporanController;
  10. use App\Http\Controllers\SessionController;
  11. use App\Http\Controllers\TindakanController;
  12. use App\Http\Controllers\UsersController;
  13. use App\Models\RiwayatLaporan;
  14. use Illuminate\Support\Facades\Route;
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Web Routes
  18. |--------------------------------------------------------------------------
  19. |
  20. | Here is where you can register web routes for your application. These
  21. | routes are loaded by the RouteServiceProvider and all of them will
  22. | be assigned to the "web" midRequest $requesteware group. Make something great!
  23. |
  24. */
  25. Route::group(['middleware' => 'auth'], function ()
  26. {
  27. });
  28. Route::middleware(['auth', 'check.role:admin'])->group(function () {
  29. // Rute yang hanya dapat diakses oleh admin
  30. #Dashboard
  31. Route::get('dashboards', [DashboardController::class, 'index'])->name('admin.dashboards');
  32. #User
  33. Route::get('/user', [UsersController::class, 'index'])->name('user.index');
  34. Route::get('/user/create', [UsersController::class, 'create'])->name('user.create');
  35. Route::post('/user/create', [UsersController::class, 'store'])->name('user.store');
  36. Route::get('/user/{id}/edit', [UsersController::class, 'edit'])->name('user.edit');
  37. Route::put('/user/{id}/edit', [UsersController::class, 'update'])->name('user.update');
  38. Route::get('/user/{id}', [UsersController::class, 'destroy'])->name('user.destroy');
  39. #Tindakan
  40. Route::get('/tindakan', [TindakanController::class, 'index'])->name('tindakan.index');
  41. Route::get('/tindakan/{id}/edit', [TindakanController::class, 'edit'])->name('tindakan.edit');
  42. Route::get('/tindakan/{id}/show', [TindakanController::class, 'show'])->name('tindakan.show');
  43. Route::put('/tindakan/{id}/edit', [TindakanController::class, 'update'])->name('tindakan.update');
  44. Route::get('/tindakan/{id}', [TindakanController::class, 'destroy'])->name('tindakan.destroy');
  45. #Informasi
  46. Route::get('/informasi', [InformasiController::class, 'adminIndex'])->name('informasi.adminIndex');
  47. Route::get('/informasi/create', [InformasiController::class, 'adminCreate'])->name('informasi.adminCreate');
  48. Route::post('/informasi/create', [InformasiController::class, 'adminStore'])->name('informasi.adminStore');
  49. Route::get('/informasi/{id}/edit', [InformasiController::class, 'adminEdit'])->name('informasi.adminEdit');
  50. Route::put('/informasi/{id}/edit', [InformasiController::class, 'adminUpdate'])->name('informasi.adminUpdate');
  51. Route::get('/informasi/{id}', [InformasiController::class, 'adminDestroy'])->name('informasi.adminDestroy');
  52. #Apresiasi
  53. Route::get('/apresiasi-system', [ApresiasiController::class, 'adminIndex'])->name('apresiasi.adminIndex');
  54. Route::get('/apresiasi-system/{id}', [ApresiasiController::class, 'adminDestroy'])->name('apresiasi.adminDestroy');
  55. Route::get('/apresiasi-system/{id}/show', [ApresiasiController::class, 'adminShow'])->name('apresiasi.adminShow');
  56. });
  57. Route::middleware(['auth', 'check.role:user'])->group(function () {
  58. // Rute yang hanya dapat diakses oleh user biasa
  59. #Dashboard
  60. Route::get('/dashboard', [AdminController::class, 'index'])->name('users.dashboard');
  61. #Pelaporan
  62. Route::get('/pelaporan', [PelaporanController::class, 'index'])->name('pelaporan.index');
  63. Route::get('/pelaporan/create', [PelaporanController::class, 'create'])->name('pelaporan.create');
  64. Route::post('/pelaporan/create', [PelaporanController::class, 'store'])->name('pelaporan.store');
  65. Route::get('/pelaporan/{id}/edit', [PelaporanController::class, 'edit'])->name('pelaporan.edit');
  66. Route::put('/pelaporan/{id}/edit', [PelaporanController::class, 'update'])->name('pelaporan.update');
  67. Route::get('/pelaporan/{id}', [PelaporanController::class, 'destroy'])->name('pelaporan.destroy');
  68. #Informasi
  69. Route::get('/informasi-system', [InformasiController::class, 'userIndex'])->name('informasi.userIndex');
  70. Route::get('/informasi-system/{id}/show', [InformasiController::class, 'userShow'])->name('informasi.userShow');
  71. #Apresiasi
  72. Route::get('/apresiasi', [ApresiasiController::class, 'userIndex'])->name('apresiasi.userIndex');
  73. Route::get('/apresiasi/create', [ApresiasiController::class, 'userCreate'])->name('apresiasi.userCreate');
  74. Route::post('/apresiasi/create', [ApresiasiController::class, 'userStore'])->name('apresiasi.userStore');
  75. Route::get('/apresiasi/{id}/edit', [ApresiasiController::class, 'userEdit'])->name('apresiasi.userEdit');
  76. Route::get('/apresiasi/{id}/show', [ApresiasiController::class, 'userShow'])->name('apresiasi.userShow');
  77. Route::put('/apresiasi/{id}/edit', [ApresiasiController::class, 'userUpdate'])->name('apresiasi.userUpdate');
  78. Route::get('/apresiasi/{id}', [ApresiasiController::class, 'userDestroy'])->name('apresiasi.userDestroy');
  79. });
  80. #Riwayat Pelaporan
  81. Route::get('/riwayat-pelaporan', [RiwayatLaporanController::class, 'index'])->name('riwayat.index');
  82. Route::get('/riwayat-pelaporan/cetak', [RiwayatLaporanController::class, 'cetak'])->name('riwayat.cetak');
  83. #Panduan
  84. Route::get('/panduan', [PanduanController::class, 'index'])->name('panduan.index');
  85. #Profile
  86. Route::get('/profile', [ProfileController::class, 'index'])->name('profile.index');
  87. Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');
  88. #Sesion
  89. Route::get('/', [SessionController::class, 'index'])->name('index.login');
  90. Route::post('/', [SessionController::class, 'login'])->name('login');
  91. Route::get('/registrasi', [SessionController::class, 'showRegistrationForm'])->name('register');
  92. Route::post('/registrasi', [SessionController::class, 'signup'])->name('signup');
  93. Route::get('/logout', [SessionController::class, 'logout'])->name('logout');
  94. Route::get('/forgot-password', [SessionController::class, 'forgot'])->name('forgot');
  95. Route::post('/forgot-password', [SessionController::class, 'sendResetLink'])->name('sendResetLink');
  96. Route::get('/reset/{token}', [SessionController::class, 'showResetForm'])->name('password.reset');
  97. Route::post('/reset/{token}', [SessionController::class, 'resetPassword'])->name('reset.password');