<?php

class PublicController extends Controller
{
    public function home(): void
    {
        if (Auth::check()) {
            $this->redirect('/dashboard');
        }

        $metaTitle = setting('seo_title', seo_title()) ?: seo_title();
        $metaDescription = setting('seo_description', seo_description()) ?: seo_description();

        $this->view('public/home', [
            'metaTitle' => $metaTitle,
            'metaDescription' => $metaDescription,
            'canonicalUrl' => site_url('/'),
        ], 'public');
    }
}
