假设我们有以下自定义验证器:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
我正在通过FormRequest使用Laravel的验证。代码的摘录在这里。laravel的验证似乎是让"user@hotmail“这样的电子邮件地址通过。
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class DirectorForm extends FormRequest
{
public function rules()
{
return [
'email' => 'required|em