Add dashboard widgets

This commit is contained in:
2020-06-27 04:49:55 +01:00
parent 5a8c080a31
commit 71efdf93d8
4 changed files with 258 additions and 26 deletions

View File

@@ -3,13 +3,29 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Vacancy;
use App\User;
use App\Ban;
use App\Application;
class DashboardController extends Controller
{
public function index()
{
return view('dashboard.dashboard');
$totalPeerReview = Application::where('applicationStatus', 'STAGE_PEERAPPROVAL')->get()->count();
$totalNewApplications = Application::where('applicationStatus', 'STAGE_SUBMITTED')->get()->count();
$totalDenied = Application::where('applicationStatus', 'DENIED')->get()->count();
return view('dashboard.dashboard')
->with([
'vacancies' => Vacancy::all(),
'totalUserCount' => User::all()->count(),
'totalDenied' => $totalDenied,
'totalPeerReview' => $totalPeerReview,
'totalNewApplications' => $totalNewApplications
]);
}
}