Skip to content

Commit

Permalink
-[x] send oldest dates for each component
Browse files Browse the repository at this point in the history
  • Loading branch information
PG-Momik committed Jul 10, 2023
1 parent 0b45dc2 commit db3a7b4
Show file tree
Hide file tree
Showing 5 changed files with 339 additions and 327 deletions.
4 changes: 3 additions & 1 deletion app/Http/Controllers/Admin/Dashboard/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public function __construct(
*/
public function index(): Renderable
{
return view('admin.dashboard.index');
$oldestDates = $this->dashboardService->getOldestDate();

return view('admin.dashboard.index', compact('oldestDates'));
}

/**
Expand Down
9 changes: 9 additions & 0 deletions app/IATI/Services/Dashboard/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,13 @@ public function resolveStartDateAndEndDate($request, array $params, string $tabl

return $params;
}

public function getOldestDate(): array
{
return [
'user'=> $this->userRepo->getOldestData()?->created_at->format('Y-m-d') ?? '',
'activity'=> $this->activityRepo->getOldestData()?->created_at->format('Y-m-d') ?? '',
'publisher'=> $this->organizationRepo->getOldestData()?->created_at->format('Y-m-d') ?? '',
];
}
}
Loading

0 comments on commit db3a7b4

Please sign in to comment.