Skip to content

Commit d7bc3de

Browse files
committed
Create ValidLatitude.php
1 parent 7fc397f commit d7bc3de

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/Rules/ValidLatitude.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Milwad\LaravelValidate\Rules;
4+
5+
use Illuminate\Contracts\Validation\Rule;
6+
7+
class ValidLatitude implements Rule
8+
{
9+
/**
10+
* Check base64.
11+
*/
12+
public function passes($attribute, $value): bool
13+
{
14+
return base64_encode(base64_decode($value, true)) === $value;
15+
}
16+
17+
/**
18+
* Get the validation error message.
19+
*/
20+
public function message(): string
21+
{
22+
return __('validate.latitude');
23+
}
24+
}

0 commit comments

Comments
 (0)