示例#1
0
 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'));
 }
示例#2
0
 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'));
 }