<?php

namespace App\Http\Controllers\website;

use App\Models\Menu;
use App\Models\About;
use App\Models\Donar;
use App\Models\Event;
use App\Models\Banner;
use App\Models\Social;
use App\Models\WhatWe;
use App\Models\Product;
use App\Models\Project;
use App\Models\Service;
use App\Models\Activity;
use App\Models\Donation;
use App\Models\Province;
use App\Models\SCounter;
use App\Models\SlideShow;
use App\Models\PagesImage;
use Illuminate\Support\Arr;
use App\Models\ImageGallary;
use Illuminate\Http\Request;
use App\Models\AboutCategory;
use Illuminate\Support\Facades\Log;
use App\Http\Controllers\Controller;
use App\Models\Counter;
use App\Models\Post;
use Illuminate\Contracts\Session\Session;

class HomeController extends Controller
{
    // showing website home page




    public function index($lang)
    {

        // example:


        $about = About::first();
        $about_categories= AboutCategory::latest()->limit(3)->get();
        $sliders = SlideShow::latest()->where('type','Home')->get();
        $product_video = ImageGallary::where('section','Product')->first();
        $branches = Product::limit(4)->get();
        $services = Service::latest()->limit(4)->get();
        $water_calculator = Banner::where('section','Water_Calculation')->first();
        $history = Banner::where('section','History')->first();
        $events = Event::latest()->limit(3)->get();
        $appointment = Banner::where('section','Appointment')->first();
        $partners  = Social::latest()->where('type','partner')->get();
        // $branches = Project::latest()->limit(4)->get();
        $counters = Counter::limit(4)->get();
        $clients = Post::where('section','Client')->get();
        return view('website.home.index',compact('sliders','clients','appointment','product_video','services','events','partners','about_categories','about','branches','counters'));
    }


}