diff --git a/lang/en/about.php b/lang/en/about.php index c3dfb855..bc886ca2 100644 --- a/lang/en/about.php +++ b/lang/en/about.php @@ -1,5 +1,7 @@ 'About the SiteBoss CMS', 'version' => 'Version', diff --git a/lang/en/auth.php b/lang/en/auth.php index fd25c37b..bf670dda 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -1,5 +1,7 @@ 'Pages', diff --git a/lang/en/passwords.php b/lang/en/passwords.php index 2345a56b..05f156a5 100644 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -1,5 +1,7 @@ 'User preferences', 'subtitle' => 'Here you can change your preferences', diff --git a/lang/en/response.php b/lang/en/response.php index a4f8e132..dd5c8516 100644 --- a/lang/en/response.php +++ b/lang/en/response.php @@ -1,5 +1,7 @@ 'Unauthorized user', 'tokenexp' => 'Token expired', diff --git a/lang/en/support.php b/lang/en/support.php index d5ecb987..5bbe6c59 100644 --- a/lang/en/support.php +++ b/lang/en/support.php @@ -1,5 +1,7 @@ 'Support', 'breadcrumb' => 'Support', diff --git a/lang/en/ui.php b/lang/en/ui.php index 442a6817..bad585a9 100644 --- a/lang/en/ui.php +++ b/lang/en/ui.php @@ -1,5 +1,7 @@ 'Save', 'save_no_redirect' => 'Save and stay on this page', diff --git a/lang/en/validation.php b/lang/en/validation.php index 9fab4d92..d866a605 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -1,5 +1,7 @@ 'Over SiteBoss CMS', 'version' => 'Versie', diff --git a/lang/nl/auth.php b/lang/nl/auth.php index 1c76b973..5bc24ecb 100644 --- a/lang/nl/auth.php +++ b/lang/nl/auth.php @@ -1,5 +1,7 @@ "Pagina's", 'edit' => 'Wijzig pagina', diff --git a/lang/nl/passwords.php b/lang/nl/passwords.php index ddb63d1f..5035ba53 100644 --- a/lang/nl/passwords.php +++ b/lang/nl/passwords.php @@ -1,5 +1,7 @@ 'Gebruikersvoorkeuren', 'subtitle' => 'Wijzig hier je voorkeuren', diff --git a/lang/nl/redirects.php b/lang/nl/redirects.php index 65582938..37c8e6fa 100644 --- a/lang/nl/redirects.php +++ b/lang/nl/redirects.php @@ -1,5 +1,7 @@ 'Doorverwijzingen', 'widget_title' => 'Overzicht van alle doorverwijzingen', diff --git a/lang/nl/response.php b/lang/nl/response.php index 26fe3b54..87453860 100644 --- a/lang/nl/response.php +++ b/lang/nl/response.php @@ -1,5 +1,7 @@ 'Gebruiker onbevoegd', 'tokenexp' => 'Token verlopen', diff --git a/lang/nl/support.php b/lang/nl/support.php index ce7063e9..1c75deaf 100644 --- a/lang/nl/support.php +++ b/lang/nl/support.php @@ -1,5 +1,7 @@ 'Support', 'breadcrumb' => 'Support', diff --git a/lang/nl/ui.php b/lang/nl/ui.php index 2abfe65f..7d783f03 100644 --- a/lang/nl/ui.php +++ b/lang/nl/ui.php @@ -1,5 +1,7 @@ 'Opslaan', 'save_no_redirect' => 'Opslaan en op deze pagina blijven', diff --git a/lang/nl/validation.php b/lang/nl/validation.php index 96f9efd7..5cab5be9 100644 --- a/lang/nl/validation.php +++ b/lang/nl/validation.php @@ -1,5 +1,7 @@ group(function () { - Route::prefix('api')->group(function () { +Route::prefix(config('siteboss.api_prefix'))->group(function (): void { + Route::prefix('api')->group(function (): void { Route::get('email/verify/{id}/{hash}', [VerifyEmailController::class, '__invoke']) ->middleware([ValidateSignature::class, 'throttle:6,1']) ->name('siteboss.verification.verify'); // Unauthenticated routes - Route::namespace('Forms')->group(function () { + Route::namespace('Forms')->group(function (): void { Route::post('forms/{form:id}/{langurl}', [DataController::class, 'create'])->middleware(ProtectAgainstSpam::class)->name('formbuilder.post'); Route::get('fields/{id}', [FieldController::class, 'readOneJson']); // RIGHTS!!!!! @@ -52,9 +54,9 @@ Route::get('settings', [InfoController::class, 'settings']); // Authenticated routes - Route::group(['middleware' => ['auth:openid', 'api', EnsureEmailIsVerified::class]], function () { + Route::group(['middleware' => ['auth:openid', 'api', EnsureEmailIsVerified::class]], function (): void { // Language for messages (not the language used for storing data) - Route::group(['prefix' => '/{locale}', 'middleware' => 'set-forget-locale'], function () { + Route::group(['prefix' => '/{locale}', 'middleware' => 'set-forget-locale'], function (): void { Route::get('info', [InfoController::class, 'index']); // TODO: remove this route? @@ -66,7 +68,7 @@ // Form builder Route::middleware('role:forms')->group(__DIR__.'/cms/forms.php'); - Route::prefix('app')->group(function () { + Route::prefix('app')->group(function (): void { if (file_exists(base_path().'/routes/siteboss.php')) { Route::prefix('site')->group( base_path().'/routes/siteboss.php' @@ -99,7 +101,7 @@ Route::get('about', [AboutController::class, 'index']); // Support page for SiteBoss CMS - Route::prefix('support')->group(function () { + Route::prefix('support')->group(function (): void { Route::get('', [SupportController::class, 'index']); Route::post('', [SupportController::class, 'update']); }); diff --git a/routes/cms/demo.php b/routes/cms/demo.php index c24c9ea9..e8c515fc 100644 --- a/routes/cms/demo.php +++ b/routes/cms/demo.php @@ -1,5 +1,7 @@ group(function () { +Route::prefix('table')->group(function (): void { Route::get('', [CmsEditorTableController::class, 'index']); Route::post('', [CmsEditorTableController::class, 'create']); - Route::prefix('{table}')->group(function () { + Route::prefix('{table}')->group(function (): void { Route::get('', [CmsEditorTableController::class, 'readOne']); Route::post('', [CmsEditorTableController::class, 'update']); Route::put('move', [CmsEditorTableController::class, 'updatePosition']); Route::post('add-field', [CmsEditorTableController::class, 'addField']); - Route::prefix('{tableItem}')->group(function () { + Route::prefix('{tableItem}')->group(function (): void { Route::get('', [CmsEditorTableItemController::class, 'readOne']); Route::post('', [CmsEditorTableItemController::class, 'update']); Route::post('enabled', [CmsEditorTableItemController::class, 'enabled']); @@ -36,11 +38,11 @@ }); // pages -Route::prefix('page')->group(function () { +Route::prefix('page')->group(function (): void { Route::get('', [CmsEditorTemplateController::class, 'index']); Route::post('', [CmsEditorTemplateController::class, 'create']); - Route::prefix('{table}')->group(function () { + Route::prefix('{table}')->group(function (): void { Route::get('', [CmsEditorTemplateController::class, 'readOne']); Route::post('', [CmsEditorTemplateController::class, 'update']); Route::post('import', [CmsEditorImportExportController::class, 'importTemplate']); @@ -48,7 +50,7 @@ Route::put('move', [CmsEditorTemplateController::class, 'updatePosition']); Route::post('add-field', [CmsEditorTemplateController::class, 'addField']); - Route::prefix('{tableItem}')->group(function () { + Route::prefix('{tableItem}')->group(function (): void { Route::get('', [CmsEditorTemplateItemController::class, 'readOne']); Route::post('', [CmsEditorTemplateItemController::class, 'update']); Route::post('enabled', [CmsEditorTemplateItemController::class, 'enabled']); @@ -56,26 +58,26 @@ }); }); -Route::prefix('menu')->group(function () { +Route::prefix('menu')->group(function (): void { Route::get('', [CmsEditorMenuController::class, 'index']); Route::post('', [CmsEditorMenuController::class, 'addItem']); Route::put('move', [CmsEditorMenuController::class, 'updatePosition']); - Route::prefix('{menuItem}')->group(function () { + Route::prefix('{menuItem}')->group(function (): void { Route::get('', [CmsEditorMenuController::class, 'readOne']); Route::post('', [CmsEditorMenuController::class, 'update']); Route::delete('', [CmsEditorMenuController::class, 'deleteRecord']); }); }); -Route::prefix('lang')->group(function () { +Route::prefix('lang')->group(function (): void { Route::get('', [CmsEditorLangController::class, 'index']); Route::post('', [CmsEditorLangController::class, 'create']); Route::put('move', [CmsEditorLangController::class, 'updatePosition']); - Route::prefix('{lang:id}')->group(function () { + Route::prefix('{lang:id}')->group(function (): void { Route::get('', [CmsEditorLangController::class, 'readOne']); Route::post('', [CmsEditorLangController::class, 'update']); Route::delete('', [CmsEditorLangController::class, 'deleteRecord']); diff --git a/routes/cms/forms.php b/routes/cms/forms.php index b9a55222..7a242fa6 100644 --- a/routes/cms/forms.php +++ b/routes/cms/forms.php @@ -1,5 +1,7 @@ group(function () { +Route::namespace('Forms')->group(function (): void { // /forms - Route::prefix('forms')->group(function () { + Route::prefix('forms')->group(function (): void { Route::post('', [FormController::class, 'create']); Route::get('combinations', [FormController::class, 'readAllCombinations']); Route::get('archive', [FormController::class, 'readAllArchive']); // /forms/categories - Route::prefix('categories')->group(function () { + Route::prefix('categories')->group(function (): void { Route::get('', [CategoryController::class, 'readAllBasedOnRights']); Route::get('{category:slug}', [FormController::class, 'readAllBasedOnCategory']); }); // /forms/{id} - Route::prefix('{form:id}')->group(function () { + Route::prefix('{form:id}')->group(function (): void { Route::delete('', [FormController::class, 'delete']); Route::put('', [FormController::class, 'update']); Route::post('clone', [FormController::class, 'clone']); @@ -31,13 +33,13 @@ Route::get('csv', [DownloadController::class, 'downloadReport']); // /forms/{id}/settings - Route::prefix('settings')->group(function () { + Route::prefix('settings')->group(function (): void { Route::get('', [FormController::class, 'getText']); Route::put('', [FormController::class, 'updateText']); }); // /forms/{id}/fields - Route::prefix('fields')->group(function () { + Route::prefix('fields')->group(function (): void { Route::get('', [FieldController::class, 'readOne']); Route::patch('', [FieldController::class, 'update']); @@ -46,13 +48,13 @@ }); // /forms/{id}/data - Route::prefix('data')->group(function () { + Route::prefix('data')->group(function (): void { Route::get('', [DataController::class, 'readOne']); Route::get('all', [DataController::class, 'readOneAll']); Route::get('filled', [DataController::class, 'readOneFilled']); // /forms/{id}/data/{id} - Route::prefix('{recordId}')->group(function () { + Route::prefix('{recordId}')->group(function (): void { Route::delete('', [DataController::class, 'deleteRow']); Route::patch('', [DataController::class, 'updateField']); }); diff --git a/routes/cms/forwards.php b/routes/cms/forwards.php index a01de46a..7c164eda 100644 --- a/routes/cms/forwards.php +++ b/routes/cms/forwards.php @@ -1,16 +1,18 @@ group(function () { +Route::prefix('domains')->group(function (): void { Route::get('/', [ForwardsController::class, 'readAll']); Route::get('/{domain:id}', [ForwardsController::class, 'readOne']); }); -Route::prefix('options')->group(function () { +Route::prefix('options')->group(function (): void { Route::get('/', [ForwardsController::class, 'readAll']); Route::get('/rules/', [ForwardsController::class, 'readAll']); }); diff --git a/routes/cms/menu.php b/routes/cms/menu.php index 930223bd..a343ed60 100644 --- a/routes/cms/menu.php +++ b/routes/cms/menu.php @@ -1,5 +1,7 @@ group(function () { +Route::prefix('{menu}/editor/{langSlug}')->group(function (): void { Route::get('', [PageEditorController::class, 'index']); Route::post('', [PageEditorController::class, 'update']); Route::get('{fieldInternal}', [PageItemEditorController::class, 'ajaxGet']); diff --git a/routes/cms/redirects.php b/routes/cms/redirects.php index 4d1dc80a..76d5ed7f 100644 --- a/routes/cms/redirects.php +++ b/routes/cms/redirects.php @@ -1,5 +1,7 @@ group(function () { +Route::prefix('{table:url}')->group(function (): void { Route::get('', [TableOverviewController::class, 'index']); Route::put('', [TableOverviewController::class, 'updateField']); Route::post('', [TableOverviewController::class, 'create']); Route::put('move', [TableOverviewController::class, 'updatePosition']); // /table/{slug}/{recordId} - Route::prefix('{recordId}')->group(function () { + Route::prefix('{recordId}')->group(function (): void { Route::delete('', [TableEditorController::class, 'deleteRecord']); // /table/{slug}/{recordId}/{lang} - Route::prefix('{langSlug}')->group(function () { + Route::prefix('{langSlug}')->group(function (): void { Route::get('', [TableEditorController::class, 'index']); Route::post('', [TableEditorController::class, 'update']); diff --git a/routes/cms/users.php b/routes/cms/users.php index 629be3e8..f3d3bbc0 100644 --- a/routes/cms/users.php +++ b/routes/cms/users.php @@ -1,5 +1,7 @@ run(); diff --git a/src/Services/Editor/FieldsProperties.php b/src/Services/Editor/FieldsProperties.php index 9538a06c..f2aaad48 100644 --- a/src/Services/Editor/FieldsProperties.php +++ b/src/Services/Editor/FieldsProperties.php @@ -25,7 +25,7 @@ public function __construct($properties = null) public function availableFields() { - $fields = ['Text', 'Checkbox', 'ChildTable', 'DropDown', 'Tags', 'Description', 'TableSelect', 'Header', 'DatePicker', 'TimePicker', 'DateTimePicker', 'Image', 'File', 'Filter', 'ContentBlocks', 'Button', 'Slug', 'Number', 'ModelSelect']; + $fields = ['Text', 'Checkbox', 'ChildTable', 'DropDown', 'Tags', 'Description', 'TableSelect', 'Header', 'DatePicker', 'TimePicker', 'DateTimePicker', 'Image', 'File', 'ContentBlocks', 'Button', 'Slug', 'Number', 'ModelSelect']; sort($fields); return $fields;