WechatControllerValidate.php 556 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Http\Validate;
  3. use Illuminate\Support\Facades\Validator;
  4. class WechatControllerValidate extends BaseValidate
  5. {
  6. /**
  7. * 设置菜单参数校验
  8. * @param $data
  9. */
  10. public function setMenu($data)
  11. {
  12. $validate = Validator::make($data,
  13. [
  14. "wechat_app_code"=>"required",
  15. ]
  16. );
  17. if($validate->fails()){
  18. //验证错误
  19. $this->setError($validate->errors()->first());
  20. return false;
  21. }
  22. return true;
  23. }
  24. }