diff --git a/lang/en/models.php b/lang/en/models.php index 80fff6a8..0e5b914f 100644 --- a/lang/en/models.php +++ b/lang/en/models.php @@ -2,7 +2,7 @@ return [ "classes" => [ - "user" => "user", + "user" => "user|users", "dynamic-page" => "dynamic page|dynamic pages", "page-config" => "page configuration|page configurations", "activity-log" => "activity log", diff --git a/lang/fr/models.php b/lang/fr/models.php index 5b3bd528..6b011ce7 100644 --- a/lang/fr/models.php +++ b/lang/fr/models.php @@ -2,7 +2,7 @@ return [ "classes" => [ - "user" => "utilisateur", + "user" => "utilisateur|utilisateurs", "dynamic-page" => "page dynamique|pages dynamiques", "page-config" => "configuration de page|configurations de page", "activity-log" => "journal d'activité", diff --git a/manifest.yaml b/manifest.yaml index 4feac966..10b191eb 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -7,7 +7,7 @@ data: APP_ENV: "${APP_APP_ENV}" APP_KEY: "${APP_APP_KEY}" APP_DEBUG: "${APP_APP_DEBUG}" - APP_URL: "https://${APP_DOMAIN}" + APP_URL: "https://${REDIRECT}${APP_DOMAIN}" LOG_CHANNEL: "k8s" CACHE_STORE: "${APP_CACHE_STORE}" DB_HOST: "${APP_DB_HOST}" @@ -158,11 +158,14 @@ spec: - web - websecure routes: - - match: Host(`${APP_DOMAIN}`) + - match: Host(`${APP_DOMAIN}`) || Host(`www.${APP_DOMAIN}`) kind: Rule services: - name: ${CI_PROJECT_PATH_SLUG}-service port: 80 + middlewares: + - name: redirect-no-www-to-www + tls: secretName: ${CRT_TLS_NAME} --- diff --git a/phpstan.neon b/phpstan.neon index 1fdaadd3..48592866 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,4 +5,4 @@ parameters: paths: - app/ - level: 5 + level: 7 diff --git a/production-resources.yaml b/production-resources.yaml index f940be0a..ea6f2a6e 100644 --- a/production-resources.yaml +++ b/production-resources.yaml @@ -5,6 +5,7 @@ metadata: spec: dnsNames: - $APP_DOMAIN + - www.${APP_DOMAIN} secretName: $APP_DOMAIN issuerRef: name: $APP_CERT_ISSUER diff --git a/resources/ts/back/Components/Layout/AppSidebar.tsx b/resources/ts/back/Components/Layout/AppSidebar.tsx index 817f3033..f8b53337 100644 --- a/resources/ts/back/Components/Layout/AppSidebar.tsx +++ b/resources/ts/back/Components/Layout/AppSidebar.tsx @@ -164,7 +164,7 @@ export default function AppSidebar() { choice: 2, }); const transAdmin = useTrans("enums.user-role.admin"); - const transUsers = useTrans("models.classes.user"); + const transUsers = useTrans("models.classes.user", { choice: 2 }); const transActivityLogs = useTrans("models.classes.activity-log"); const transPageConfigs = useTrans("models.classes.page-config", { choice: 2, diff --git a/resources/ts/back/Pages/Users/Create.tsx b/resources/ts/back/Pages/Users/Create.tsx index 8e524265..84d1f398 100644 --- a/resources/ts/back/Pages/Users/Create.tsx +++ b/resources/ts/back/Pages/Users/Create.tsx @@ -22,7 +22,7 @@ export default function Create({ data }: { data: SingleResource }) { : "crud.helpers.creation_model", { params: { - model: useTrans("models.classes.user"), + model: useTrans("models.classes.user", { choice: 1 }), }, }, ); diff --git a/resources/ts/back/Pages/Users/Edit.tsx b/resources/ts/back/Pages/Users/Edit.tsx index b79c6ff2..798cbe21 100644 --- a/resources/ts/back/Pages/Users/Edit.tsx +++ b/resources/ts/back/Pages/Users/Edit.tsx @@ -41,7 +41,9 @@ export default function Edit({ data }: { data: SingleResource }) { return ( diff --git a/resources/ts/back/Pages/Users/Index.tsx b/resources/ts/back/Pages/Users/Index.tsx index d1f9cd6d..9ac7c4ca 100644 --- a/resources/ts/back/Pages/Users/Index.tsx +++ b/resources/ts/back/Pages/Users/Index.tsx @@ -187,7 +187,7 @@ export default function Index({ return ( Stringable; /** - * Pascal case a word based. + * Upper case the first letter of a word based. * Examples: * - some $ in the GARDEN ! -> Some $ in the GARDEN ! * @@ -28,7 +28,7 @@ interface Stringable { */ ucFirst: () => Stringable; /** - * Pascal case a word based. + * Camel case a word based. * Examples: * - Some $ in the GARDEN ! -> some$InTheGarden! * diff --git a/resources/views/components/front/search/content.blade.php b/resources/views/components/front/search/content.blade.php index f249b244..ff8889b6 100644 --- a/resources/views/components/front/search/content.blade.php +++ b/resources/views/components/front/search/content.blade.php @@ -20,6 +20,7 @@ 'terms' => $searchTerm, ]); $currentLocale = app()->getLocale(); + $routeAjax = route('front.searching.ajax.news'); @endphp @push('scripts') @@ -46,7 +47,7 @@ results.innerHTML = ''; pagination.innerHTML = ''; - fetch('/search/load/results', { + fetch(@json($routeAjax), { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/routes/web-front.php b/routes/web-front.php index 1462af97..d9ec6363 100644 --- a/routes/web-front.php +++ b/routes/web-front.php @@ -26,12 +26,11 @@ Route::group( ->where('unsubscribe', 'unsubscribe|unsubscribe.php|unsubscribe.html|newsletter') ->name('unsubscribeNewsletter'); - // Search routes. Route::get(LaravelLocalization::transRoute('routes.front.search'), [SearchController::class, 'search']) ->name('search'); - Route::post('/search/load/results', [SearchController::class, 'ajaxSearchLoadResults']) - ->name('search.ajax.news'); + Route::post('/searching/load/results', [SearchController::class, 'ajaxSearchLoadResults']) + ->name('searching.ajax.news'); // Filters routes. Route::prefix('posts')->group(function () {