public function home() { $lastRecords = MammalRecord::where('numPics', '>', 0)->where('accepted', TRUE)->orderBy('updated_at', 'desc')->take(4)->get(); $fixedArticles = Article::latest('date_to_publish')->where('approved', true)->where('fixed_position', '>', 0)->where('date_to_publish', '<=', Carbon::now())->get(); $lastArticles = Article::latest('date_to_publish')->where('approved', true)->where('date_to_publish', '<=', Carbon::now())->get(); return view('home4', compact('lastRecords', 'lastArticles', 'fixedArticles')); }
public function map($atlas) { if ($atlas = "mammal") { $project = "Mamíferos"; $records = MammalRecord::where('accepted', 'TRUE')->orderBy('updated_at')->get(); } return view('records.map', compact('project', 'records')); }