public function devices(ChartData $request): JsonResponse 	{ 		$user = $request->user(); 		$min_date = formatTimestamp($request->min_date, 'Y-m-d H:i', $user->timezone); 		$max_date = formatTimestamp($request->max_date, 'Y-m-d H:i', $user->timezone);  		$records = PushDevice::whereBetween('created_at', [$min_date, $max_date]) 			->oldest() 			->get() 			->groupBy(function ($date) use ($request): string { 				return formatLocalTimestamp($date->created_at, $request->date_format); 			});  		$devices = [];  		foreach ($records as $key => $value) { 			$devices[] = ['date' => $key, 'value' => count($value)]; 		}  		return response()->json(['data' => $devices]); 	}