-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show chart of balance per day on dashboard
- Loading branch information
1 parent
ce52f61
commit 3d05e49
Showing
8 changed files
with
566 additions
and
1,911 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Repositories\DashboardRepository; | ||
use Carbon\CarbonImmutable; | ||
use Illuminate\Http\Request; | ||
|
||
class DashboardController extends Controller | ||
{ | ||
public function __invoke(DashboardRepository $dashboardRepository, Request $request) | ||
{ | ||
/** @var ApiKey $apiKey */ | ||
$apiKey = $request->get('apiKey'); | ||
|
||
$space = $apiKey->user->spaces()->first(); | ||
|
||
return response() | ||
->json([ | ||
'daily_balance' => $dashboardRepository->getDailyBalance( | ||
spaceId: $space->id, | ||
year: CarbonImmutable::now()->year, | ||
month: CarbonImmutable::now()->month, | ||
), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.