Completed
Push — master ( 1353b4...67caad )
by Abdelrahman
01:48 queued 11s
created

SupportServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Support\Providers;
6
7
use Illuminate\Support\ServiceProvider;
8
use Illuminate\Support\Facades\Validator;
9
10
class SupportServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function boot()
16
    {
17
        // Add strip_tags validation rule
18
        Validator::extend('strip_tags', function ($attribute, $value) {
19
            return strip_tags($value) === $value;
20
        }, trans('validation.invalid_strip_tags'));
21
    }
22
}
23