temp show specific report period

This commit is contained in:
omair saleh
2021-10-11 14:23:14 +08:00
parent f844f5d879
commit a21465992f
@@ -19,8 +19,9 @@ use Illuminate\Http\Request;
class MonthlyReportController
{
public function salesReport(Request $request): JsonResponse {
$today = Carbon::now();
$containers = Container::whereMonth('loading_date', $today->format('m'))->whereYear('loading_date', $today->format('Y'))->orderBy('loading_date')->get();
$today = Carbon::now()->subMonth();
$containers = Container::whereDay('loading_date', '>=', 1)->whereDay('loading_date', '<=', 5)->whereMonth('loading_date', $today->format('m'))->whereYear('loading_date', $today->format('Y'))->orderBy('loading_date')->get();
$packages = $containers->flatMap(function ($container) {