Пример #1
0
 public function getCreate($data = null)
 {
     // ------------------------------------------------------------------------------------------------------------
     // GET TRAVEL AGENTS
     // ------------------------------------------------------------------------------------------------------------
     $travel_agents = \App\TravelAgent::orderBy('name')->get();
     // ------------------------------------------------------------------------------------------------------------
     // GET DESTINATIONS
     // ------------------------------------------------------------------------------------------------------------
     $destinations = \App\Destination::orderBy('path')->get();
     // ------------------------------------------------------------------------------------------------------------
     // GET PLACES
     // ------------------------------------------------------------------------------------------------------------
     $places = \App\Place::orderBy('long_name')->get();
     // ------------------------------------------------------------------------------------------------------------
     // GET TOUR OPTIONS
     // ------------------------------------------------------------------------------------------------------------
     $tour_options = \App\TourOption::orderBy('name')->get();
     // ------------------------------------------------------------------------------------------------------------
     // GET TAGS
     // ------------------------------------------------------------------------------------------------------------
     $tag_list = \App\Tag::orderBy('tag')->get();
     // ------------------------------------------------------------------------------------------------------------
     // SHOW DISPLAY
     // ------------------------------------------------------------------------------------------------------------
     $this->layout->page = view($this->page_base_dir . 'create')->with('route_name', $this->route_name)->with('view_name', $this->view_name);
     $this->layout->page->data = $data;
     $this->layout->page->travel_agents = $travel_agents;
     $this->layout->page->destinations = $destinations;
     $this->layout->page->places = $places;
     $this->layout->page->tour_options = $tour_options;
     $this->layout->page->tag_list = $tag_list;
     $this->layout->page->required_images = $this->required_images;
     return $this->layout;
 }
Пример #2
0
 public function index()
 {
     // create new sitemap object
     $sitemap = App::make("sitemap");
     // set cache key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)
     // by default cache is disabled
     $sitemap->setCache('laravel.sitemap', 60);
     // check if there is cached sitemap and build new only if is not
     if (!$sitemap->isCached()) {
         // add item to the sitemap (url, date, priority, freq)
         $sitemap->add(url('about'), Carbon::createFromDate(2016, 7, 15), '0.3', 'monthly');
         $sitemap->add(url('privacy'), Carbon::createFromDate(2016, 7, 15), '0.3', 'monthly');
         $sitemap->add(url('terms'), Carbon::createFromDate(2016, 7, 15), '0.3', 'monthly');
         $designers = Designer::orderBy('created_at', 'desc')->get();
         foreach ($designers as $designer) {
             $sitemap->add($designer->url, $designer->updated_at, 0.8, 'daily');
         }
         $places = Place::orderBy('created_at', 'desc')->get();
         foreach ($places as $place) {
             $sitemap->add($place->url, $place->updated_at, 0.8, 'daily');
         }
         $stories = Story::orderBy('created_at', 'desc')->get();
         foreach ($stories as $story) {
             $sitemap->add($story->url, $story->updated_at, 0.8, 'daily');
         }
         $tags = Tag::orderBy('created_at', 'desc')->get();
         foreach ($tags as $tag) {
             $sitemap->add($tag->url, $tag->updated_at, 0.8, 'weekly');
         }
     }
     // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
     return $sitemap->render('xml');
 }
Пример #3
0
 /**
  * Show the home page.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $designers = Designer::orderBy('id', 'desc')->take(9)->get();
     $places = Place::orderBy('id', 'desc')->take(9)->get();
     $stories = Story::whereHas('translations', function ($sub_query) {
         $sub_query->whereIn('locale', ['en', App::getLocale()])->whereNotNull('title')->whereNotNull('content');
     })->orderBy('id', 'desc')->take(9)->get();
     $tags = Tag::orderByRaw('RAND()')->take(9)->get();
     return view('pages.home', ['designers' => $designers, 'places' => $places, 'stories' => $stories, 'tags' => $tags]);
 }