Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Code quality #180

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from
2 changes: 2 additions & 0 deletions lang/en/about.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'About the SiteBoss CMS',
'version' => 'Version',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/en/page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

// TODO: update values to use proper naming convention
return [
'title' => 'Pages',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/passwords.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/en/preferences.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'User preferences',
'subtitle' => 'Here you can change your preferences',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'unauth' => 'Unauthorized user',
'tokenexp' => 'Token expired',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/support.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Support',
'breadcrumb' => 'Support',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/ui.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'save' => 'Save',
'save_no_redirect' => 'Save and stay on this page',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/validation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/about.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Over SiteBoss CMS',
'version' => 'Versie',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => "Pagina's",
'edit' => 'Wijzig pagina',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/passwords.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/preferences.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Gebruikersvoorkeuren',
'subtitle' => 'Wijzig hier je voorkeuren',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/redirects.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Doorverwijzingen',
'widget_title' => 'Overzicht van alle doorverwijzingen',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'unauth' => 'Gebruiker onbevoegd',
'tokenexp' => 'Token verlopen',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/support.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Support',
'breadcrumb' => 'Support',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/ui.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'save' => 'Opslaan',
'save_no_redirect' => 'Opslaan en op deze pagina blijven',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/validation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
16 changes: 9 additions & 7 deletions routes/api.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Auth\Middleware\EnsureEmailIsVerified;
use NotFound\Framework\Http\Controllers\AboutController;
Expand Down Expand Up @@ -27,14 +29,14 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::prefix(config('siteboss.api_prefix'))->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!!!!!
Expand All @@ -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?
Expand All @@ -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'
Expand Down Expand Up @@ -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']);
});
Expand Down
2 changes: 2 additions & 0 deletions routes/cms/demo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Http\Controllers\Demo\DemoController;

Expand Down
22 changes: 12 additions & 10 deletions routes/cms/editor.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Http\Controllers\CmsEditor\CmsEditorController;
use NotFound\Framework\Http\Controllers\CmsEditor\CmsEditorImportExportController;
Expand All @@ -16,18 +18,18 @@
Route::post('table-export', [CmsEditorImportExportController::class, 'exportAllTables']);

// table
Route::prefix('table')->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']);
Expand All @@ -36,46 +38,46 @@
});

// 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']);

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']);
});
});
});

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']);
Expand Down
18 changes: 10 additions & 8 deletions routes/cms/forms.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Http\Controllers\Forms\CategoryController;
use NotFound\Framework\Http\Controllers\Forms\DataController;
use NotFound\Framework\Http\Controllers\Forms\DownloadController;
use NotFound\Framework\Http\Controllers\Forms\FieldController;
use NotFound\Framework\Http\Controllers\Forms\FormController;

Route::namespace('Forms')->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']);
Expand All @@ -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']);

Expand All @@ -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']);
});
Expand Down
6 changes: 4 additions & 2 deletions routes/cms/forwards.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Http\Controllers\Forwards\ForwardsController;

Route::get('/', [ForwardsController::class, 'getOptions']);

Route::prefix('domains')->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']);
});
2 changes: 2 additions & 0 deletions routes/cms/menu.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use NotFound\Framework\Http\Controllers\MenuController;

Expand Down
Loading
Loading