public function getSitemapForIndexByTemplateName($templateName)
 {
     $template = Template::where('name', 'Nieuwsbericht')->firstOrFail();
     $sitemap = Sitemap::with(['translation', 'template', 'user'])->where('template_id', $template->id)->orderBy('created_at', 'asc')->get();
     return $sitemap;
 }
Ejemplo n.º 2
0
 public function getIndexLocatiesSub($sitemap_parent_id = null)
 {
     //dc(Carbon::now());
     //dc(Carbon::now()->addYear(30));
     $sitemap = Sitemap::with('translation', 'template')->find($sitemap_parent_id);
     if (is_null($sitemap)) {
         //empty object
         $sitemap = collect();
         $sitemap->id = null;
         $sitemap->translation = collect();
         $sitemap->translation->name = 'alle locaties';
     }
     request()->session()->put('previous_route', ['name' => null, 'url' => route('admin::sitemap.locaties_sub.index', ['sitemap_parent_id' => $sitemap->id]), 'anchorText' => 'sub pagina\'s van locatie \'' . $sitemap->translation->name . '\'']);
     //dc($sitemap->template->id);
     $template = "TEMPLASTE";
     $tableConfig['customSearchColumnValues'] = "['online','pending_review','concept']";
     $allowed_child_templates = Template::where('parent_id', $sitemap->template->id)->get();
     //dc($allowed_child_templates);
     return view('sitemap::indexLocatiesSub', compact('sitemap', 'allowed_child_templates', 'tableConfig'));
 }