Select Git revision
TermsController.php

Sofiane Lasri authored
- Created a new TermsController to handle the display of active terms. - Added a terms view with a markdown component for displaying content. - Updated the generic page header component to allow empty descriptions. - Modified the footer to include a link to the Terms and Conditions page. - Added a new route for the Terms and Conditions page.
TermsController.php 528 B
<?php
namespace App\Http\Controllers\Public;
use App\Http\Controllers\Controller;
use App\Models\TermsSection;
use Illuminate\View\View;
class TermsController extends Controller
{
public function __invoke(): View
{
$activeTermsText = TermsSection::where('active', true)->first();
if (! $activeTermsText) {
abort(404);
}
$activeTermsText = $activeTermsText->contentTranslationKey->getTranslation();
return view('public.terms', compact('activeTermsText'));
}
}