function init_search_tour() { // ------------------------------------------------------------------------------------------------------------ // GET TRAVEL AGENT // ------------------------------------------------------------------------------------------------------------ $this->all_travel_agents = Cache::remember('all_travel_agent_list', 60, function () { return TravelAgent::orderby('name')->get(); }); // ------------------------------------------------------------------------------------------------------------ // GET DESTINATION // ------------------------------------------------------------------------------------------------------------ $this->all_destinations = Cache::remember('all_destination_list', 60, function () { return Destination::orderby('name')->get(); }); // ------------------------------------------------------------------------------------------------------------ // GET DEPARTURE LISTS // ------------------------------------------------------------------------------------------------------------ $month = ['', 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember']; $now = \Carbon\Carbon::now(); $departure_list = []; for ($i = 1; $i <= 12; $i++) { $departure_list[$now->year . str_pad($now->month, '2', '0', STR_PAD_LEFT)] = $month[$now->month] . ' ' . $now->year; $now->addMonth(); } $this->departure_list = $departure_list; // ------------------------------------------------------------------------------------------------------------ // GET BUDGET // ------------------------------------------------------------------------------------------------------------ $this->budget_list = [0 => "Semua budget", '0-1000000' => "Di bawah Rp. 1.000.000", '1000000-2500000' => "Rp. 1.000.000 - Rp. 2.500.000", '2500000-5000000' => "Rp. 2.500.000 - Rp. 5.000.000", '5000000-10000000' => "Rp. 5.000.000 - Rp. 10.000.000", '10000000-20000000' => "Rp. 10.000.000 - Rp. 20.000.000", '20000000' => "Rp. 20.000.000 ke atas"]; // ------------------------------------------------------------------------ // TOUR OPTIONS // ------------------------------------------------------------------------ $this->option_list = Cache::remember('all_option_list', 120, function () { return \App\TourOption::orderBy('name')->get(); }); // ------------------------------------------------------------------------ // SHORTCUT TOUR LIST // ------------------------------------------------------------------------ $this->tour_shortcut['destinations']['Eropa Barat'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'eropa,eropa-barat']); $this->tour_shortcut['destinations']['Eropa Timur'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'eropa,eropa-timur']); $this->tour_shortcut['destinations']['Asia'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'asia']); $this->tour_shortcut['destinations']['Australia'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'australia']); $this->tour_shortcut['destinations']['Amerika'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'amerika']); $this->tour_shortcut['destinations']['China'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'asia,china']); $this->tour_shortcut['destinations']['Domestik'] = route('web.tour', ['travel_agent' => 'semua-travel-agent', 'destination' => 'domestik']); $this->tour_shortcut['tags']['#Religius'] = route('web.tour.tag', ['tag' => 'religius']); $this->tour_shortcut['tags']['#Adventure'] = route('web.tour.tag', ['tag' => 'adventure']); $this->tour_shortcut['tags']['#HoneyMoon'] = route('web.tour.tag', ['tag' => 'honeymoon']); ksort($this->tour_shortcut['destinations']); ksort($this->tour_shortcut['tags']); }