123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Providers;
- use Illuminate\Support\Facades\Validator;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- /**
- * Register any application services.
- *
- * @return void
- */
- public function register()
- {
- //
- }
- /**
- * Bootstrap any application services.
- *
- * @return void
- */
- public function boot()
- {
- //
- Validator::extend('mobile', function ($attribute, $value, $parameters, $validator) {
- return $validator->validateRegex(
- $attribute,
- $value,
- ['/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/']
- );
- });
- }
- }
|