You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
812 B

<?php
namespace App\Providers;
use App\Rules\Idcard;
use App\Rules\Mobile;
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 (new Mobile)->passes($attribute, $value);
});
Validator::extend('idcard', function ($attribute, $value, $parameters, $validator) {
return (new Idcard)->passes($attribute, $value);
});
}
}