123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Http\Validate;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Validator;
- class CeshiValidate extends BaseValidate
- {
- public function index($data)
- {
- $validate = Validator::make($data,
- [
- "title"=>"required"
- ]
- );
- if($validate->fails()){
- //验证错误
- $this->setError($validate->errors()->first());
- return false;
- }
- return true;
- }
- }
|