Skip to content

Commit

Permalink
make routing with group
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 31, 2024
1 parent f2844bc commit 893298e
Showing 1 changed file with 48 additions and 40 deletions.
88 changes: 48 additions & 40 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,55 +61,63 @@

Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard');

Route::get('federations/import', [FederationManagementController::class, 'index'])->name('federations.unknown');
Route::post('federations/import', [FederationManagementController::class, 'store'])->name('federations.import');
Route::get('federations/refresh', [FederationManagementController::class, 'update'])->name('federations.refresh');

Route::get('federations/{federation}/entities', [FederationEntityController::class, 'index'])->name('federations.entities')->withTrashed();

Route::get('federations/{federation}/operators', [FederationOperatorController::class, 'index'])->name('federations.operators')->withTrashed();

Route::get('federations/{federation}/requests', [FederationJoinController::class, 'index'])->name('federations.requests')->withTrashed();

Route::resource('federations', FederationController::class);
Route::get('federations/{federation}', [FederationController::class, 'show'])->name('federations.show')->withTrashed();
Route::match(['put', 'patch'], 'federations/{federation}', [FederationController::class, 'update'])->name('federations.update')->withTrashed();
Route::delete('federations/{federation}', [FederationController::class, 'destroy'])->name('federations.destroy')->withTrashed();

Route::get('entities/import', [EntityManagementController::class, 'index'])->name('entities.unknown');
Route::post('entities/import', [EntityManagementController::class, 'store'])->name('entities.import');
Route::get('entities/refresh', [EntityManagementController::class, 'update'])->name('entities.refresh');

Route::get('entities/{entity}/operators', [EntityOperatorController::class, 'index'])->name('entities.operators')->withTrashed();
// Federation group
Route::group(['prefix' => 'federations', 'as' => 'federations.'], function () {
Route::get('import', [FederationManagementController::class, 'index'])->name('unknown');
Route::post('import', [FederationManagementController::class, 'store'])->name('import');
Route::get('refresh', [FederationManagementController::class, 'update'])->name('refresh');

Route::get('{federation}/entities', [FederationEntityController::class, 'index'])->name('entities')->withTrashed();
Route::get('{federation}/operators', [FederationOperatorController::class, 'index'])->name('operators')->withTrashed();
Route::get('{federation}/requests', [FederationJoinController::class, 'index'])->name('requests')->withTrashed();

Route::resource('/', FederationController::class)->parameters(['' => 'federation'])->withTrashed();
Route::get('{federation}', [FederationController::class, 'show'])->name('show')->withTrashed();
Route::match(['put', 'patch'], '{federation}', [FederationController::class, 'update'])->name('update')->withTrashed();
Route::delete('{federation}', [FederationController::class, 'destroy'])->name('destroy')->withTrashed();
});

Route::get('entities/{entity}/federations', [EntityFederationController::class, 'index'])->name('entities.federations')->withTrashed();
Route::post('entities/{entity}/join', [EntityFederationController::class, 'store'])->name('entities.join');
Route::post('entities/{entity}/leave', [EntityFederationController::class, 'destroy'])->name('entities.leave');
// Entities groups
Route::group(['prefix' => 'entities', 'as' => 'entities.'], function () {
Route::get('import', [EntityManagementController::class, 'index'])->name('unknown');
Route::post('import', [EntityManagementController::class, 'store'])->name('import');
Route::get('refresh', [EntityManagementController::class, 'update'])->name('refresh');

Route::post('entities/{entity}/rs', [EntityRsController::class, 'store'])->name('entities.rs');
Route::get('{entity}/operators', [EntityOperatorController::class, 'index'])->name('operators')->withTrashed();
Route::get('{entity}/federations', [EntityFederationController::class, 'index'])->name('federations')->withTrashed();
Route::post('{entity}/join', [EntityFederationController::class, 'store'])->name('join');
Route::post('{entity}/leave', [EntityFederationController::class, 'destroy'])->name('leave');

Route::get('entities/{entity}/metadata', [EntityMetadataController::class, 'store'])->name('entities.metadata');
Route::get('entities/{entity}/showmetadata', [EntityMetadataController::class, 'show'])->name('entities.showmetadata');
Route::get('entities/{entity}/previewmetadata', [EntityPreviewMetadataController::class, 'show'])->name('entities.previewmetadata');
Route::post('{entity}/rs', [EntityRsController::class, 'store'])->name('rs');

Route::post('entities/{entity}/organization', [EntityOrganizationController::class, 'update'])->name('entities.organization');
Route::get('{entity}/metadata', [EntityMetadataController::class, 'store'])->name('metadata');
Route::get('{entity}/showmetadata', [EntityMetadataController::class, 'show'])->name('showmetadata');
Route::get('{entity}/previewmetadata', [EntityPreviewMetadataController::class, 'show'])->name('previewmetadata');

Route::resource('entities', EntityController::class);
Route::get('entities/{entity}', [EntityController::class, 'show'])->name('entities.show')->withTrashed();
Route::match(['put', 'patch'], 'entities/{entity}', [EntityController::class, 'update'])->name('entities.update')->withTrashed();
Route::delete('entities/{entity}', [EntityController::class, 'destroy'])->name('entities.destroy')->withTrashed();
Route::post('{entity}/organization', [EntityOrganizationController::class, 'update'])->name('organization');

Route::get('categories/import', [CategoryManagementController::class, 'index'])->name('categories.unknown');
Route::post('categories/import', [CategoryManagementController::class, 'store'])->name('categories.import');
Route::get('categories/refresh', [CategoryManagementController::class, 'update'])->name('categories.refresh');
Route::resource('/', EntityController::class)->parameters(['' => 'entity'])->withTrashed();
Route::get('{entity}', [EntityController::class, 'show'])->name('show')->withTrashed();
Route::match(['put', 'patch'], '{entity}', [EntityController::class, 'update'])->name('update')->withTrashed();
Route::delete('{entity}', [EntityController::class, 'destroy'])->name('destroy')->withTrashed();
});

Route::resource('categories', CategoryController::class);
// Categories group
Route::group(['prefix' => 'categories', 'as' => 'categories.'], function () {
Route::get('import', [CategoryManagementController::class, 'index'])->name('unknown');
Route::post('import', [CategoryManagementController::class, 'store'])->name('import');
Route::get('refresh', [CategoryManagementController::class, 'update'])->name('refresh');

Route::get('groups/import', [GroupManagementController::class, 'index'])->name('groups.unknown');
Route::post('groups/import', [GroupManagementController::class, 'store'])->name('groups.import');
Route::get('groups/refresh', [GroupManagementController::class, 'update'])->name('groups.refresh');
Route::resource('/', CategoryController::class)->parameters(['' => 'category'])->withTrashed();
});
// Groups group
Route::group(['prefix' => 'groups', 'as' => 'groups.'], function () {
Route::get('import', [GroupManagementController::class, 'index'])->name('unknown');
Route::post('import', [GroupManagementController::class, 'store'])->name('import');
Route::get('refresh', [GroupManagementController::class, 'update'])->name('refresh');

Route::resource('groups', GroupController::class);
Route::resource('/', GroupController::class)->parameters(['' => 'group'])->withTrashed();
});

Route::resource('users', UserController::class)->except('edit', 'destroy');

Expand Down

0 comments on commit 893298e

Please sign in to comment.