Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

range-of-motion/budget

1057 stars
2 code files
View range-of-motion/budget on GitHub

app/Repositories/DashboardRepository.php

Open in GitHub
use App\Models\Space;
 
class DashboardRepository
{
public function getBalance(string $year, string $month)
{
return Space::find(session('space_id'))->monthlyBalance($year, $month);
}
//
}

app/Widgets/Balance.php

Open in GitHub
use App\Repositories\DashboardRepository;
 
class Balance
{
private $dashboardRepository;
 
public function __construct()
{
$this->dashboardRepository = new DashboardRepository();
}
 
public function render()
{
//
$balance = $this->dashboardRepository->getBalance(date('Y'), date('n'));
//
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.