Skip to content

Commit

Permalink
fix: ensure seo helper always gets strings (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Dec 7, 2023
1 parent 789febf commit 3e97f0f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Front/DecisionAuthorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function index(): RedirectResponse
public function show(string $locale, DecisionAuthor $decisionAuthor): View
{
seo()
->title($decisionAuthor->title)
->description($decisionAuthor->description);
->title((string) $decisionAuthor->title)
->description((string) $decisionAuthor->description);

return view('front.decisions.category', [
'category' => $decisionAuthor,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Front/DecisionCategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function index(): RedirectResponse
public function show(string $locale, DecisionCategory $decisionCategory): View
{
seo()
->title($decisionCategory->title)
->description($decisionCategory->description);
->title((string) $decisionCategory->title)
->description((string) $decisionCategory->description);

return view('front.decisions.category', [
'category' => $decisionCategory,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Front/DecisionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function index(): View
public function show(string $locale, Decision $decision): View
{
seo()
->title($decision->title)
->description($decision->description);
->title((string) $decision->title)
->description((string) $decision->description);

return view('front.decisions.show', [
'decision' => $decision,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Front/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class FormController extends Controller
public function show(string $locale, Form $form): View
{
seo()
->title($form->title)
->description($form->description);
->title((string) $form->title)
->description((string) $form->description);

return view('front.forms.show', [
'form' => $form,
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/Front/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function index(): View
$image = $page->firstMedia('image');

seo()
->title($page->title)
->description($page->description)
->image($image?->getUrl());
->title((string) $page->title)
->description((string) $page->description)
->image((string) $image?->getUrl());

return view('front.pages.show', [
'page' => $page,
Expand All @@ -44,9 +44,9 @@ public function show(string $locale, Page $page): RedirectResponse|View
$image = $page->firstMedia('image');

seo()
->title($page->title)
->description($page->description)
->image($image?->getUrl());
->title((string) $page->title)
->description((string) $page->description)
->image((string) $image?->getUrl());

$page->loadMissing('blocks.media');

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Front/PersonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public function show(string $locale, Person $person): View
$image = $person->firstMedia('image');

seo()
->title($person->name)
->description($person->description)
->image($image?->getUrl());
->title((string) $person->name)
->description((string) $person->description)
->image((string) $image?->getUrl());

return view('front.people.show', [
'person' => $person,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Front/PostCategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function index(): RedirectResponse
public function show(string $locale, PostCategory $postCategory): View
{
seo()
->title($postCategory->title)
->description($postCategory->description);
->title((string) $postCategory->title)
->description((string) $postCategory->description);

return view('front.posts.category', [
'category' => $postCategory,
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Front/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function show(string $locale, Post $post): View
$image = $post->firstMedia('image');

seo()
->title($post->title)
->description($post->description)
->image($image?->getUrl());
->title((string) $post->title)
->description((string) $post->description)
->image((string) $image?->getUrl());

return view('front.posts.show', [
'post' => $post,
Expand Down

0 comments on commit 3e97f0f

Please sign in to comment.