コード例 #1
0
 public function getStats()
 {
     $stats = [['title' => 'Jobs', 'value' => \App\Job::count()], ['title' => 'Featured Jobs', 'value' => \App\Job::where(['featured_flag' => 1])->count()], ['title' => 'Companies', 'value' => \App\Company::count()], ['title' => 'Featured Companies', 'value' => \App\Company::where(['is_promoted' => 1])->count()], ['title' => 'Ads', 'value' => \App\Ad::count()], ['title' => 'General ads', 'value' => \App\AdGeneral::count()]];
     return response()->json($stats);
 }