ldc-bien-etre-animal/app/Http/Controllers/Front/ApproachController.php

68 lines
2.2 KiB
PHP
Raw Normal View History

2026-08-28 08:40:04 +00:00
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Front;
use Inertia\Inertia;
use Inertia\Response;
use Uwil\LaravelCommon\Controllers\CommonController;
2026-09-03 16:52:27 +02:00
use Uwil\LaravelSchemaOrg\Services\SchemaOrgService;
2026-08-28 08:40:04 +00:00
class ApproachController extends CommonController
{
/**
* Show why this approach page.
*/
2026-09-03 16:52:27 +02:00
public function whyThisApproach(SchemaOrgService $schemaOrg): Response
2026-08-28 08:40:04 +00:00
{
2026-09-03 16:52:27 +02:00
$trans = trans('why_this_approach');
$title = str_replace('\n', ' ', $trans['title']);
2026-09-04 12:15:37 +02:00
$title = preg_replace('/\s+/', ' ', $title) ?? $title;
2026-09-03 16:52:27 +02:00
$title = strip_tags($title);
$title = trim($title);
return Inertia::render('front/Pages/Approach/WhyThisApproach', [
'schemas' => [
$schemaOrg->setWebPage()
->headline($trans['seo_title'])
->description($trans['seo_description'])
->name($title)
->isAccessibleForFree(true)
->keywords(['page'])
2026-09-04 12:15:37 +02:00
->dateCreated(new \DateTimeImmutable('2026-09-03'))
->dateModified(new \DateTimeImmutable('2026-09-03'))
->datePublished(new \DateTimeImmutable('2026-09-03')),
],
2026-09-03 16:52:27 +02:00
]);
2026-08-28 08:40:04 +00:00
}
/**
* Show animal welfare page.
*/
2026-09-03 16:52:27 +02:00
public function animalWelfare(SchemaOrgService $schemaOrg): Response
2026-08-28 08:40:04 +00:00
{
2026-09-03 16:52:27 +02:00
$trans = trans('animal_welfare');
$title = str_replace('\n', ' ', $trans['title']);
2026-09-04 12:15:37 +02:00
$title = preg_replace('/\s+/', ' ', $title) ?? $title;
2026-09-03 16:52:27 +02:00
$title = strip_tags($title);
$title = trim($title);
return Inertia::render('front/Pages/Approach/AnimalWelfare', [
'schemas' => [
$schemaOrg->setWebPage()
2026-09-07 10:09:49 +02:00
->headline($trans['meta']['seo_title'])
->description($trans['meta']['seo_description'])
2026-09-03 16:52:27 +02:00
->name($title)
->isAccessibleForFree(true)
->keywords(['page'])
2026-09-04 12:15:37 +02:00
->dateCreated(new \DateTimeImmutable('2026-09-03'))
->dateModified(new \DateTimeImmutable('2026-09-03'))
->datePublished(new \DateTimeImmutable('2026-09-03')),
],
2026-09-03 16:52:27 +02:00
]);
2026-08-28 08:40:04 +00:00
}
}