1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Http\Validate;
- use Illuminate\Support\Facades\Validator;
- class AdminControllerValidate extends BaseValidate
- {
- /**
- * 后台用户登录验证
- * @param $data
- */
- public function login($data)
- {
- $validate = Validator::make($data,
- [
- "adminAccount"=>"required",
- "adminPassword"=>"required",
- ]
- );
- if($validate->fails()){
- //验证错误
- $this->setError($validate->errors()->first());
- return false;
- }
- return true;
- }
- }
|