withTrashed()) ->dateColumn('reserved_date') ->between( start: now()->startOfYear(), end: now()->endOfYear(), ) ->perMonth() ->count(); return [ 'datasets' => [ [ 'label' => __('Reservations'), 'data' => $data->map(fn (TrendValue $value) => $value->aggregate), ], ], 'labels' => $data->map(fn (TrendValue $value) => $value->date), ]; } protected function getType(): string { return 'line'; } public static function canView(): bool { if (auth()->user()->is_admin==true) { return true; } else { return false; } } }