diff --git a/resources/views/dashboard/classifications/index.blade.php b/resources/views/dashboard/classifications/index.blade.php index 44db03d..a2b93a0 100644 --- a/resources/views/dashboard/classifications/index.blade.php +++ b/resources/views/dashboard/classifications/index.blade.php @@ -11,6 +11,7 @@

{{$title}}

+ @if (is_role(['1']))
@@ -33,6 +34,7 @@
+ @endif
diff --git a/resources/views/dashboard/locations/index.blade.php b/resources/views/dashboard/locations/index.blade.php index 5570074..4c2a1da 100644 --- a/resources/views/dashboard/locations/index.blade.php +++ b/resources/views/dashboard/locations/index.blade.php @@ -11,6 +11,7 @@

{{$title}}

+ @if (is_role(['1']))
@@ -33,6 +34,7 @@
+ @endif
diff --git a/resources/views/dashboard/sub-classifications/index.blade.php b/resources/views/dashboard/sub-classifications/index.blade.php index 5dabf7d..b2f5746 100644 --- a/resources/views/dashboard/sub-classifications/index.blade.php +++ b/resources/views/dashboard/sub-classifications/index.blade.php @@ -11,6 +11,7 @@

{{$title}}

+ @if (is_role(['1']))
@@ -33,6 +34,7 @@
+ @endif
diff --git a/resources/views/dashboard/sub-locations/index.blade.php b/resources/views/dashboard/sub-locations/index.blade.php index b21f826..ab40097 100644 --- a/resources/views/dashboard/sub-locations/index.blade.php +++ b/resources/views/dashboard/sub-locations/index.blade.php @@ -11,6 +11,7 @@

{{$title}}

+ @if (is_role(['1']))
@@ -33,6 +34,7 @@
+ @endif
diff --git a/resources/views/partials/dashboard/sidebar.blade.php b/resources/views/partials/dashboard/sidebar.blade.php index 20eafad..d56a3a6 100644 --- a/resources/views/partials/dashboard/sidebar.blade.php +++ b/resources/views/partials/dashboard/sidebar.blade.php @@ -30,6 +30,16 @@ Ikhtisar + @if (is_role([3])) +
  • + + + Ajakan Kerjasama + 10 + +
  • + @endif + @if (is_role('1'))
  • Master
  • @@ -63,6 +73,8 @@ OPD + @endif + @if (is_role(['1']))
  • Kelola
  • @@ -90,6 +102,7 @@ Pengaturan Aplikasi + @endif
  • Data
  • @@ -112,7 +125,7 @@
  • -
    Kerjasama Eksternal
    +
    Kerjasama {{is_role(['1']) ? 'Eksternal' : ''}}
  • @@ -144,15 +157,19 @@ Arsip
  • + @if (is_role(['1', '2', '4']))
  • Monitoring
  • + @if (is_role(['1', '4']))
  • Rekap Konten
  • + @endif + @if (is_role(['1', '2']))
  • @@ -165,6 +182,9 @@ Manajemen Isu
  • + @endif + @endif + @if (is_role(['1']))
  • Autentikasi
  • @@ -180,6 +200,7 @@ Role + @endif
    diff --git a/routes/web.php b/routes/web.php index 68c631b..df5a231 100644 --- a/routes/web.php +++ b/routes/web.php @@ -48,12 +48,15 @@ Route::prefix('classifications')->name('classifications.')->group(function(){ Route::controller(ClassificationController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'classification'])->name('data'); @@ -62,12 +65,15 @@ Route::prefix('sub-classifications')->name('sub.classifications.')->group(function(){ Route::controller(SubClassificationController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'subClassification'])->name('data'); @@ -76,12 +82,15 @@ Route::prefix('locations')->name('locations.')->group(function(){ Route::controller(LocationController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'location'])->name('data'); @@ -90,12 +99,15 @@ Route::prefix('sub-locations')->name('sub.locations.')->group(function(){ Route::controller(SubLocationController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'subLocation'])->name('data'); @@ -104,12 +116,15 @@ Route::prefix('government-agencies')->name('government.agencies.')->group(function(){ Route::controller(GovernmentAgencyController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'governmentAgency'])->name('data'); @@ -118,80 +133,98 @@ Route::prefix('news')->name('news.')->group(function(){ Route::controller(NewsController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'news'])->name('data'); }); - Route::prefix('settings')->name('settings.')->group(function(){ - Route::controller(SettingController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::put('/', 'update')->name('update'); + Route::middleware('role:1')->group(function(){ + Route::prefix('settings')->name('settings.')->group(function(){ + Route::controller(SettingController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::put('/', 'update')->name('update'); + }); }); }); Route::prefix('airing-proof-themes')->name('airing.proof.themes.')->group(function(){ Route::controller(AiringProofThemeController::class)->group(function(){ Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + + Route::middleware('role:1')->group(function(){ + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); }); Route::get('/data', [DatatableController::class, 'airingProofTheme'])->name('data'); }); - Route::prefix('companies')->name('companies.')->group(function(){ - Route::controller(CompanyController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); - }); + Route::middleware('role:1,3')->group(function(){ + Route::prefix('companies')->name('companies.')->group(function(){ + Route::controller(CompanyController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/{id}/show', 'show')->name('show'); + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); - Route::get('/data', [DatatableController::class, 'company'])->name('data'); + Route::get('/data', [DatatableController::class, 'company'])->name('data'); + }); }); - Route::prefix('media')->name('media.')->group(function(){ - Route::controller(MediaController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); - }); + Route::middleware('role:1,3')->group(function(){ + Route::prefix('media')->name('media.')->group(function(){ + Route::controller(MediaController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/{id}/show', 'show')->name('show'); - Route::get('/data', [DatatableController::class, 'media'])->name('data'); + + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); + + Route::get('/data', [DatatableController::class, 'media'])->name('data'); + }); }); - Route::prefix('journalists')->name('journalists.')->group(function(){ - Route::controller(JournalistController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); - }); + Route::middleware('role:1,3')->group(function(){ + Route::prefix('journalists')->name('journalists.')->group(function(){ + Route::controller(JournalistController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/{id}/show', 'show')->name('show'); - Route::get('/data', [DatatableController::class, 'journalist'])->name('data'); + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); + + Route::get('/data', [DatatableController::class, 'journalist'])->name('data'); + }); }); + Route::middleware('role:1,4')->group(function(){}); Route::prefix('content-recaps')->name('content.recaps.')->group(function(){ Route::controller(ContentRecapController::class)->group(function(){ Route::get('/', 'index')->name('index'); @@ -206,62 +239,72 @@ Route::get('/data', [DatatableController::class, 'contentRecap'])->name('data'); }); - Route::prefix('media-monitorings')->name('media.monitoring.')->group(function(){ - Route::controller(MediaMonitoringController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); - Route::post('/check-link', 'checkLink')->name('check.link'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); - }); + Route::middleware('role:1,2')->group(function(){ + Route::prefix('media-monitorings')->name('media.monitoring.')->group(function(){ + Route::controller(MediaMonitoringController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::post('/check-link', 'checkLink')->name('check.link'); + Route::get('/{id}/show', 'show')->name('show'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); - Route::get('/data', [DatatableController::class, 'mediaMonitoring'])->name('data'); + Route::get('/data', [DatatableController::class, 'mediaMonitoring'])->name('data'); + }); }); - Route::prefix('issue-managements')->name('issue.managements.')->group(function(){ - Route::controller(IssueManagementController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/{media_monitoring_id}', 'store')->name('store'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::delete('/{id}', 'destroy')->name('destroy'); + Route::middleware('role:1,2')->group(function(){ + Route::prefix('issue-managements')->name('issue.managements.')->group(function(){ + Route::controller(IssueManagementController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/create', 'create')->name('create'); + Route::post('/{media_monitoring_id}', 'store')->name('store'); + Route::get('/{id}/show', 'show')->name('show'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::delete('/{id}', 'destroy')->name('destroy'); - // AJAX - Route::get('/get-sub-locations/{location_id}', 'getSubLocations')->name('get.sub.locations'); - Route::get('/get-sub-classifications/{classification_id}', 'getSubClassifications')->name('get.sub.classifications'); + // AJAX + Route::get('/get-sub-locations/{location_id}', 'getSubLocations')->name('get.sub.locations'); + Route::get('/get-sub-classifications/{classification_id}', 'getSubClassifications')->name('get.sub.classifications'); + }); + + Route::get('/data', [DatatableController::class, 'issueManagement'])->name('data'); }); - - Route::get('/data', [DatatableController::class, 'issueManagement'])->name('data'); }); - Route::prefix('users')->name('users.')->group(function(){ - Route::controller(UserController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - Route::get('/create', 'create')->name('create'); - Route::post('/', 'store')->name('store'); - Route::get('/{id}/show', 'show')->name('show'); - Route::get('/{id}/edit', 'edit')->name('edit'); - Route::put('/{id}', 'update')->name('update'); - Route::get('/{id}/reset', 'resetPassword')->name('reset.password'); - Route::post('/{id}/reset', 'resetPasswordAction')->name('reset.password.action'); - Route::put('/{id}/{action}/status', 'statusAction')->name('status.action'); - Route::delete('/{id}', 'destroy')->name('destroy'); - }); + Route::middleware('role:1')->group(function(){ + Route::prefix('users')->name('users.')->group(function(){ + Route::controller(UserController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + Route::get('/create', 'create')->name('create'); + Route::post('/', 'store')->name('store'); + Route::get('/{id}/show', 'show')->name('show'); + Route::get('/{id}/edit', 'edit')->name('edit'); + Route::put('/{id}', 'update')->name('update'); + Route::get('/{id}/reset', 'resetPassword')->name('reset.password'); + Route::post('/{id}/reset', 'resetPasswordAction')->name('reset.password.action'); + Route::put('/{id}/{action}/status', 'statusAction')->name('status.action'); + Route::delete('/{id}', 'destroy')->name('destroy'); + }); - Route::get('/data', [DatatableController::class, 'user'])->name('data'); + Route::get('/data', [DatatableController::class, 'user'])->name('data'); + }); }); - Route::prefix('roles')->name('role.')->group(function(){ - Route::controller(RoleController::class)->group(function(){ - Route::get('/', 'index')->name('index'); - }); + Route::middleware('role:1')->group(function(){ + Route::prefix('roles')->name('role.')->group(function(){ + Route::controller(RoleController::class)->group(function(){ + Route::get('/', 'index')->name('index'); + }); - Route::get('/data', [DatatableController::class, 'role'])->name('data'); + Route::get('/data', [DatatableController::class, 'role'])->name('data'); + }); }); + + }); });