['required', 'numeric', 'between:-90,90'], 'longitude' => ['required', 'numeric', 'between:-180,180'], 'speed' => ['nullable', 'numeric', 'min:0', 'max:500'], 'bearing' => ['nullable', 'numeric', 'min:0', 'max:360'], 'accuracy' => ['nullable', 'numeric', 'min:0'], 'altitude' => ['nullable', 'numeric'], 'timestamp' => ['nullable', 'date'], ]; } /** * Get custom attributes for validator errors. */ public function attributes(): array { return [ 'latitude' => 'location latitude', 'longitude' => 'location longitude', 'bearing' => 'direction bearing', ]; } /** * Get the error messages for the defined validation rules. */ public function messages(): array { return [ 'latitude.between' => 'The latitude must be between -90 and 90 degrees.', 'longitude.between' => 'The longitude must be between -180 and 180 degrees.', 'bearing.max' => 'The bearing must be between 0 and 360 degrees.', ]; } }