From ffbe35719defba9be15b51b7ab1fa7dc7a4b237a Mon Sep 17 00:00:00 2001 From: Dipesh Khanal <63183800+Dipesh79@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:35:42 +0545 Subject: [PATCH] feat: latitude and longitude rules (#7) --- composer.json | 3 ++- src/Rules/LatitudeRule.php | 25 +++++++++++++++++++++++++ src/Rules/LongitudeRule.php | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/Rules/LatitudeRule.php create mode 100644 src/Rules/LongitudeRule.php diff --git a/composer.json b/composer.json index 60a6a14..605e198 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "src/helpers.php" ], "psr-4": { - "AchyutN\\Traits\\": "src/Traits/" + "AchyutN\\Traits\\": "src/Traits/", + "AchyutN\\Rules\\": "src/Rules/" } }, "autoload-dev": { diff --git a/src/Rules/LatitudeRule.php b/src/Rules/LatitudeRule.php new file mode 100644 index 0000000..a66a698 --- /dev/null +++ b/src/Rules/LatitudeRule.php @@ -0,0 +1,25 @@ + 90) { + $fail("The $attribute must be between -90 and 90."); + } + } +} diff --git a/src/Rules/LongitudeRule.php b/src/Rules/LongitudeRule.php new file mode 100644 index 0000000..44cb42a --- /dev/null +++ b/src/Rules/LongitudeRule.php @@ -0,0 +1,25 @@ + 180) { + $fail("The $attribute must be between -180 and 180."); + } + } +}