Use Carbon::toDateString function (#1571)

This commit is contained in:
Alexis Saettler
2018-07-14 15:49:56 +02:00
committed by GitHub
parent e764f39377
commit a95d0f3368
13 changed files with 29 additions and 27 deletions
@@ -34,8 +34,8 @@ class ApiStatisticsController extends ApiController
$dateSundayLastWeek = $dateSundayLastWeek->endOfWeek();
// Get the number of users last monday
$instanceLastMonday = Statistic::whereDate('created_at', '=', $dateMondayLastWeek->format('Y-m-d'))->first();
$instanceLastSunday = Statistic::whereDate('created_at', '=', $dateSundayLastWeek->format('Y-m-d'))->first();
$instanceLastMonday = Statistic::whereDate('created_at', '=', $dateMondayLastWeek->toDateString())->first();
$instanceLastSunday = Statistic::whereDate('created_at', '=', $dateSundayLastWeek->toDateString())->first();
$numberNewUsers = 0;
if ($instanceLastMonday && $instanceLastSunday) {