|
170 | 170 | // Knowledge Graph |
171 | 171 | Route::get('/graph', [GraphController::class, 'index'])->name('graph.index'); |
172 | 172 |
|
173 | | - // Plugins (Bug 2: was missing web route) |
174 | | - Route::get('/plugins', fn () => Inertia::render('Admin/Plugins/Index'))->name('admin.plugins'); |
| 173 | + // Plugins |
| 174 | + Route::get('/plugins', function () { |
| 175 | + $plugins = \App\Models\Plugin::withTrashed()->with('settings')->orderBy('display_name')->get(); |
| 176 | + |
| 177 | + return Inertia::render('Admin/Plugins/Index', [ |
| 178 | + 'plugins' => \App\Http\Resources\PluginResource::collection($plugins)->resolve(), |
| 179 | + ]); |
| 180 | + })->name('admin.plugins'); |
175 | 181 |
|
176 | 182 | // Media (Bug 3: was missing web route) |
177 | 183 | Route::get('/media', fn () => Inertia::render('Media/Index'))->name('admin.media'); |
178 | 184 |
|
179 | | - // Locales / i18n settings (Bug 5: was missing web route) |
180 | | - Route::get('/settings/locales', fn () => Inertia::render('Settings/Locales'))->name('admin.settings.locales'); |
| 185 | + // Locales / i18n settings |
| 186 | + Route::get('/settings/locales', function () { |
| 187 | + $localeService = app(\App\Services\LocaleService::class); |
| 188 | + $space = app()->bound('current_space') ? app('current_space') : \App\Models\Space::first(); |
| 189 | + $locales = $space ? $space->locales()->get() : collect(); |
| 190 | + $rawSupported = $localeService->getSupportedLocales(); |
| 191 | + $supported = collect($rawSupported)->map(fn ($label, $code) => ['code' => $code, 'label' => $label])->values(); |
| 192 | + |
| 193 | + return Inertia::render('Settings/Locales', ['locales' => $locales, 'supported' => $supported]); |
| 194 | + })->name('admin.settings.locales'); |
181 | 195 | }); |
0 commit comments