<?php

namespace App\Http\Controllers\FrontendController;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class PageController extends Controller
{
    // About 
    public function about()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.about', compact('bodyClass'));
    }

    // Become Volunteer
    public function becomeVolunteer()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.becomeVolunteer', compact('bodyClass'));
    }

    // Blog
    public function blog()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.blog', compact('bodyClass'));
    }

    // Blog Details
    public function blogDetails()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.blogDetails', compact('bodyClass'));
    }

    // Blog grid
    public function blogGrid()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.blogGrid', compact('bodyClass'));
    }

    // cart 
    public function cart()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.cart', compact('bodyClass'));
    }

    // Cause Details 
    public function causeDetails()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.causeDetails', compact('bodyClass'));
    }

    // Checkout 
    public function checkout()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.checkout', compact('bodyClass'));
    }

    // Contact 
    public function contact()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.contact', compact('bodyClass'));
    }

    public function submitContact(Request $request)
    {
        $request->validate([
            'full-name' => ['required', 'string', 'max:255'],
            'c-email' => ['required', 'email', 'max:255'],
            'phone-number' => ['required', 'string', 'max:30'],
            'contact-message' => ['nullable', 'string', 'max:5000'],
        ]);

        return back()->with('status', 'Thanks for contacting us. We will get back to you soon.');
    }

    // Donate Us 
    public function donateUs()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.donateUs', compact('bodyClass'));
    }

    public function submitDonate(Request $request)
    {
        $request->validate([
            'c-name' => ['required', 'string', 'max:255'],
            'c-lastname' => ['required', 'string', 'max:255'],
            'c-email' => ['required', 'email', 'max:255'],
            'c-phone' => ['required', 'string', 'max:30'],
        ]);

        return back()->with('status', 'Thanks for your donation interest. We will get back to you soon.');
    }

    // Events
    public function events()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.events', compact('bodyClass'));
    }

    // Events Details
    public function eventsDetails()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.eventsDetails', compact('bodyClass'));
    }

    // Faq
    public function faq()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.faq', compact('bodyClass'));
    }

    // Our Causes
    public function ourCauses()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.ourCauses', compact('bodyClass'));
    }

    // Our Team
    public function ourTeam()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.ourTeam', compact('bodyClass'));
    }

    // Privacy Policy
    public function privacyPolicy()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.privacyPolicy', compact('bodyClass'));
    }

    // Product Details
    public function productDetails()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.productDetails', compact('bodyClass'));
    }

    // shop
    public function shop()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.shop', compact('bodyClass'));
    }

    // Team Details
    public function teamDetails()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.teamDetails', compact('bodyClass'));
    }
    
    // Terms Conditions
    public function termsConditions()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.termsConditions', compact('bodyClass'));
    }

    // 404 Not Found
    public function notFound()
    {
        $bodyClass = '';
        return $this->safeView('frontend.pages.notFound', compact('bodyClass'));
    }

}
