2018-12-10 07:32:53 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: merdan
|
|
|
|
|
* Date: 12/9/2018
|
|
|
|
|
* Time: 12:39 PM
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Event;
|
2019-08-28 06:34:37 +00:00
|
|
|
use App\Models\Slider;
|
2018-12-10 07:32:53 +00:00
|
|
|
use Carbon\Carbon;
|
|
|
|
|
|
|
|
|
|
class PublicController extends Controller
|
|
|
|
|
{
|
|
|
|
|
private $data;
|
|
|
|
|
|
|
|
|
|
public function showHomePage(){
|
2019-08-30 06:50:33 +00:00
|
|
|
$cinema = Event::cinema()->onLive()->take(11)->get();
|
|
|
|
|
// dd($cinema);
|
2019-08-31 09:35:36 +00:00
|
|
|
$theatre = Event::theatre()->onLive()->take(6)->get();
|
|
|
|
|
$musical = Event::musical()->onLive()->take(8)->get();
|
2019-08-28 06:34:37 +00:00
|
|
|
$sliders = Slider::where('active',1)->get();
|
|
|
|
|
return view('Bilettm.Public.HomePage')->with([
|
|
|
|
|
'cinema' => $cinema,
|
|
|
|
|
'theatre' => $theatre,
|
|
|
|
|
'musical' => $musical,
|
|
|
|
|
'sliders' => $sliders
|
|
|
|
|
]);
|
2018-12-10 07:32:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function showCategoryEvents($category_id){
|
|
|
|
|
$events = Event::where('end_date', '>', Carbon::now())
|
|
|
|
|
->where('category_id',$category_id)
|
|
|
|
|
->take(10)
|
|
|
|
|
->get();
|
|
|
|
|
$this->data['events'] = $events;
|
|
|
|
|
$this->data['category_id']= $category_id;
|
|
|
|
|
// print_r($this->data);
|
|
|
|
|
return view('Public.CategoryEventsPage', $this->data);
|
|
|
|
|
}
|
|
|
|
|
}
|