<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Post;
use App\User;
use App\Category;
use App\Comment;
use App\Client;
use Auth;

class Events extends Controller
{

    /********************************** 
    * Display a listing of the resource.
    * @return \Illuminate\Http\Response
    ***********************************/
    public function index()
    {
        $Categores  = Category::all();
        $Events =  Client::oldest()->simplepaginate(12);
        $SlideEvents =  Client::simplepaginate(8);
        return view('Pages.Events.index',compact('Events','Categores','SlideEvents'));
    }
    
    /**
     * Display the specified resource.
     *
     * @param  int  $slug
     * @return \Illuminate\Http\Response
    **/
    public function show($slug)
    {
        $Event = Client::where('slug', '=', $slug)->firstOrFail();
        //To Get Comments Event
        $Comments = $Event->Comments; 
        // To Get Change The Language
        return view('Pages.Events.show',compact('Event','Comments'));
    }
}
