2026-08-26 13:43:30 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\StoicPage;
|
2026-10-26 16:06:55 +02:00
|
|
|
use App\Support\StorePlaceholders;
|
2026-08-26 13:43:30 +03:00
|
|
|
|
|
|
|
|
class LegalPageController extends Controller
|
|
|
|
|
{
|
2026-09-28 17:09:04 +03:00
|
|
|
public function __construct(
|
2026-10-26 16:06:55 +02:00
|
|
|
private readonly StorePlaceholders $placeholders,
|
2026-09-28 17:09:04 +03:00
|
|
|
) {}
|
|
|
|
|
|
2026-08-26 13:43:30 +03:00
|
|
|
public function terms(string $locale)
|
|
|
|
|
{
|
|
|
|
|
return $this->show('terms-and-conditions');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function shippingReturns(string $locale)
|
|
|
|
|
{
|
|
|
|
|
return $this->show('shipping-returns');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function privacy(string $locale)
|
|
|
|
|
{
|
|
|
|
|
return $this->show('privacy-policy');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function cookies(string $locale)
|
|
|
|
|
{
|
|
|
|
|
return $this->show('cookies-policy');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function show(string $slug)
|
|
|
|
|
{
|
2026-09-28 18:16:43 +03:00
|
|
|
$page = StoicPage::localized($slug);
|
2026-08-26 13:43:30 +03:00
|
|
|
|
|
|
|
|
if (! $page) {
|
|
|
|
|
abort(404);
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-28 17:09:04 +03:00
|
|
|
return view('legal', [
|
|
|
|
|
'page' => $page,
|
2026-10-26 16:06:55 +02:00
|
|
|
'content' => $this->placeholders->fill($page->content ?? ''),
|
2026-09-28 17:09:04 +03:00
|
|
|
]);
|
|
|
|
|
}
|
2026-08-26 13:43:30 +03:00
|
|
|
}
|