<?php

namespace App\Http\Controllers\website;

use App\Models\About;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\AboutCategory;
use App\Models\Post;
use Illuminate\Foundation\Console\AboutCommand;

class AboutController extends Controller
{
    public function index(){

        $post = About::latest()->firstOrFail();
        $categories = AboutCategory::latest()->get();

        return view('website.about.index',compact('post','categories'));


    }


     public function privacy(){
        $post = Post::where('section','Privacy')->firstOrFail();
        return view('website.post.show',compact('post'));

    }

     public function disclaimer(){
        $post = Post::where('section','disclaimer')->firstOrFail();
        return view('website.post.show',compact('post'));

    }

     public function content($lang,$id){


        $post = AboutCategory::where('id',$id)->first();
        return view('website.post.show',compact('post'));


    }

}