Skip to content

Commit

Permalink
feat: add route_enabled config
Browse files Browse the repository at this point in the history
  • Loading branch information
ast21 committed Jul 19, 2024
1 parent 2cfb2b3 commit 90a9fa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/admin-kit-localizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
return [
'disk' => 'localizations',
'path' => '{locale}.json',

'route_enabled' => true,
];
8 changes: 5 additions & 3 deletions src/UI/API/Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use AdminKit\Localizations\UI\API\Controllers\LocalizationController;
use Illuminate\Support\Facades\Route;

Route::get('/localizations', [LocalizationController::class, 'getFullList']);
Route::get('/localizations/{locale}', [LocalizationController::class, 'getLocaledList'])
->where('locale', implode('|', AdminKit::locales()));
if (config('admin-kit-localizations.route_enabled')) {
Route::get('/localizations', [LocalizationController::class, 'getFullList']);
Route::get('/localizations/{locale}', [LocalizationController::class, 'getLocaledList'])
->where('locale', implode('|', AdminKit::locales()));
}

0 comments on commit 90a9fa3

Please sign in to comment.