From bd82cc3abdf2e8a00f2c6d206574524bb31fd9dc Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Wed, 13 Jun 2018 14:07:12 +0800 Subject: [PATCH] Add docblock on ReportsRepository class --- app/Entities/Reports/ReportsRepository.php | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/Entities/Reports/ReportsRepository.php b/app/Entities/Reports/ReportsRepository.php index 0122bdf..dbf74c7 100755 --- a/app/Entities/Reports/ReportsRepository.php +++ b/app/Entities/Reports/ReportsRepository.php @@ -14,13 +14,30 @@ use App\Entities\Projects\Project; */ class ReportsRepository extends BaseRepository { + /** + * Payment model. + * + * @var \App\Entities\Payments\Payment + */ protected $model; + /** + * Create ReportsRepository class instance. + * + * @param \App\Entities\Payments\Payment $model + */ public function __construct(Payment $model) { parent::__construct($model); } + /** + * Get payment daily report. + * + * @param string $date + * @param string $q + * @return \Illuminate\Database\Eloquent\Collection + */ public function getDailyReports($date, $q) { return Payment::orderBy('date', 'desc') @@ -29,6 +46,13 @@ class ReportsRepository extends BaseRepository ->get(); } + /** + * Get payment montly report by year and month. + * + * @param string $year + * @param string $month + * @return \Illuminate\Support\Collection + */ public function getMonthlyReports($year, $month) { $rawQuery = 'date, count(`id`) as count'; @@ -52,6 +76,12 @@ class ReportsRepository extends BaseRepository return collect($reports); } + /** + * Get payment yearly report. + * + * @param string $year + * @return \Illuminate\Support\Collection + */ public function getYearlyReports($year) { $rawQuery = 'MONTH(date) as month'; @@ -76,6 +106,11 @@ class ReportsRepository extends BaseRepository return collect($reports); } + /** + * Get current credit/receiveble earnings report. + * + * @return \Illuminate\Database\Eloquent\Collection + */ public function getCurrentCredits() { // On Progress, Done, On Hold