Code

< 40 %
40-60 %
> 60 %
1
<?php
2
namespace LVR\Phone;
3
4
use Illuminate\Contracts\Validation\Rule;
5
6
class E164 extends Phone
7
{
8
    /**
9
     * Determine if the validation rule passes.
10
     *
11
     * @param  string $attribute
12
     * @param  mixed  $value
13
     *
14
     * @return bool
15
     */
16 6
    public function passes($attribute, $value)
17
    {
18 6
        return $this->isE164($value);
19
    }
20
21
    /**
22
     * Get the validation error message.
23
     *
24
     * @return string
25
     */
26 6
    public function message()
27
    {
28 6
        return ':attribute must be in E.164 phone format';
29
    }
30
}