Skip to content
Snippets Groups Projects
Select Git revision
  • 6f87f0d01373b0982076158758e6dfbf115f5048
  • master default protected
2 results

TermsController.php

Blame
  • SofianeLasri's avatar
    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.
    1de77bfa
    History
    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'));
        }
    }