首先在 Providers\AppServiceProvider.php 文件中自定义 手机号和身份证号验证 // AppServiceProvider.php 文件 <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\DB; class AppServicePr…
//校验手机号 function IsMobileNumber( num:string ):boolean; begin Result:=False; if length( trim( Num ) ) <> 11 then Exit; if ( ( copy( num, 1, 2) <> '13' ) and ( copy( num , 1, 2) <> '15' ) ) then Exit; try StrToInt(…