28 lines
552 B
PHP
28 lines
552 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Validator::extend('phone', function ($attribute, $value, $parameters, $validator) {
|
|
return preg_match('/^1[\d]{10}$/', $value);
|
|
});
|
|
}
|
|
}
|