|
17 | 17 | 'prefix' => '/'.sharp()->config()->get('custom_url_segment'), |
18 | 18 | 'middleware' => ['sharp_common', 'sharp_web'], |
19 | 19 | ], function () { |
20 | | - Route::get('/', [HomeController::class, 'index']) |
21 | | - ->name('code16.sharp.home'); |
22 | | - |
| 20 | + // Redirect GET routes without filterKey |
23 | 21 | Route::get('s-dashboard/{dashboardKey}', fn ($entityKey) => redirect( |
24 | | - route('code16.sharp.dashboard', ['root', $entityKey]) |
| 22 | + route('code16.sharp.dashboard', [ |
| 23 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 24 | + $entityKey] |
| 25 | + ) |
| 26 | + )); |
| 27 | + Route::get('s-list/{entityKey}', fn ($entityKey) => redirect( |
| 28 | + route('code16.sharp.list', [ |
| 29 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 30 | + $entityKey, |
| 31 | + ]) |
| 32 | + )); |
| 33 | + Route::get('s-show/{entityKey}', fn ($entityKey) => redirect( |
| 34 | + route('code16.sharp.single-show', [ |
| 35 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 36 | + $entityKey, |
| 37 | + ]) |
25 | 38 | )); |
26 | 39 |
|
| 40 | + Route::get('/', [HomeController::class, 'index']) |
| 41 | + ->name('code16.sharp.home'); |
| 42 | + |
27 | 43 | Route::get('{filterKey}/s-dashboard/{dashboardKey}', [DashboardController::class, 'show']) |
28 | 44 | ->name('code16.sharp.dashboard'); |
29 | 45 |
|
30 | 46 | Route::post('/s-dashboard/{dashboardKey}', [DashboardFiltersController::class, 'store']) |
31 | 47 | ->name('code16.sharp.dashboard.filters.store'); |
32 | 48 |
|
33 | | - Route::get('s-list/{entityKey}', fn ($entityKey) => redirect( |
34 | | - route('code16.sharp.list', ['root', $entityKey]) |
35 | | - )); |
36 | | - |
37 | 49 | Route::get('{filterKey}/s-list/{entityKey}', [EntityListController::class, 'show']) |
38 | 50 | ->name('code16.sharp.list'); |
39 | 51 |
|
40 | 52 | Route::post('/s-list/{entityKey}/filters', [EntityListFiltersController::class, 'store']) |
41 | 53 | ->name('code16.sharp.list.filters.store'); |
42 | 54 |
|
43 | | - Route::get('s-show/{entityKey}', fn ($entityKey) => redirect( |
44 | | - route('code16.sharp.single-show', ['root', $entityKey]) |
45 | | - )); |
46 | | - |
47 | 55 | Route::get('{filterKey}/s-show/{entityKey}', [SingleShowController::class, 'show']) |
48 | 56 | ->name('code16.sharp.single-show'); |
49 | 57 |
|
|
53 | 61 | Route::where([ |
54 | 62 | 'parentUri' => '(s-list|s-show)/.+', |
55 | 63 | ])->group(function () { |
| 64 | + // Redirect GET routes without filterKey |
| 65 | + Route::get('{parentUri}/s-show/{entityKey}/{instanceId}', fn ($parentUri, $entityKey, $instanceId) => redirect( |
| 66 | + route('code16.sharp.show.show', [ |
| 67 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 68 | + $parentUri, |
| 69 | + $entityKey, |
| 70 | + $instanceId, |
| 71 | + ]) |
| 72 | + )); |
| 73 | + Route::get('{parentUri}/s-form/{entityKey}', fn ($parentUri, $entityKey) => redirect( |
| 74 | + route('code16.sharp.form.create', [ |
| 75 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 76 | + $parentUri, |
| 77 | + $entityKey, |
| 78 | + ]) |
| 79 | + )); |
| 80 | + Route::get('{parentUri}/s-form/{entityKey}/{instanceId}', fn ($parentUri, $entityKey, $instanceId) => redirect( |
| 81 | + route('code16.sharp.form.edit', [ |
| 82 | + sharp()->context()->globalFilterUrlSegmentValue(), |
| 83 | + $parentUri, |
| 84 | + $entityKey, |
| 85 | + $instanceId, |
| 86 | + ]) |
| 87 | + )); |
| 88 | + |
56 | 89 | Route::get('/{filterKey}/{parentUri}/s-show/{entityKey}/{instanceId}', [ShowController::class, 'show']) |
57 | 90 | ->name('code16.sharp.show.show'); |
58 | 91 |
|
|
0 commit comments