simedkom/routes/web.php
2025-02-28 17:35:11 +07:00

158 lines
7.5 KiB
PHP

<?php
use App\Http\Controllers\AuthController;
use App\Http\Controllers\Dashboard\AiringProofThemeController;
use App\Http\Controllers\Dashboard\ClassificationController;
use App\Http\Controllers\Dashboard\ContentRecapController;
use App\Http\Controllers\Dashboard\DatatableController;
use App\Http\Controllers\Dashboard\GovernmentAgencyController;
use App\Http\Controllers\Dashboard\NewsController;
use App\Http\Controllers\Dashboard\OverviewController;
use App\Http\Controllers\Dashboard\RoleController;
use App\Http\Controllers\Dashboard\SettingController;
use App\Http\Controllers\Dashboard\SubClassificationController;
use App\Http\Controllers\Dashboard\UserController;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
});
Route::prefix('auth')->group(function(){
Route::controller(AuthController::class)->group(function(){
Route::get('/login', 'login')->name('login')->middleware('authenticated');
Route::name('auth.')->group(function(){
Route::post('/login', 'loginAction')->name('login.action');
Route::get('/register', 'register')->name('register')->middleware('authenticated');;
Route::post('/register', 'registerAction')->name('register.action');
Route::get('/register-success', 'registerSuccess')->name('register.success')->middleware('authenticated');;
Route::get('/logout', 'logout')->name('logout');
});
});
});
Route::middleware(['auth', 'role:1,2,3,4'])->group(function(){
Route::prefix('dashboard')->name('dashboard.')->group(function(){
Route::controller(OverviewController::class)->group(function(){
Route::get('/overview', 'index')->name('overview');
});
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::get('/data', [DatatableController::class, 'classification'])->name('data');
});
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::get('/data', [DatatableController::class, 'subClassification'])->name('data');
});
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::get('/data', [DatatableController::class, 'governmentAgency'])->name('data');
});
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::get('/data', [DatatableController::class, 'news'])->name('data');
});
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::get('/data', [DatatableController::class, 'airingProofTheme'])->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::prefix('content-recaps')->name('content.recaps.')->group(function(){
Route::controller(ContentRecapController::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::get('/data', [DatatableController::class, 'contentRecap'])->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::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::get('/data', [DatatableController::class, 'role'])->name('data');
});
});
});