From b0e99f5238ae60b1e594cbb171e6112318ff65fb Mon Sep 17 00:00:00 2001 From: Ondrej Vlach Date: Wed, 7 Aug 2024 13:00:31 +0200 Subject: [PATCH] feat(rules): add rule for CountryCode --- app/Rules/CountryCodeExists.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/Rules/CountryCodeExists.php diff --git a/app/Rules/CountryCodeExists.php b/app/Rules/CountryCodeExists.php new file mode 100644 index 0000000..2672635 --- /dev/null +++ b/app/Rules/CountryCodeExists.php @@ -0,0 +1,28 @@ +first(); + + if ($country === null) { + $fail('validation.country_code_exists_in_db'); + } + } +}