RoleUpdateRequest.php 620 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: dingran
  5. * Date: 2019/3/10
  6. * Time: 下午1:18
  7. */
  8. namespace app\platform\modules\user\requests;
  9. class RoleUpdateRequest extends Request
  10. {
  11. /**
  12. * Determine if the user is authorized to make this request.
  13. *
  14. * @return bool
  15. */
  16. public function authorize()
  17. {
  18. return true;
  19. }
  20. /**
  21. * Get the validation rules that apply to the request.
  22. *
  23. * @return array
  24. */
  25. public function rules()
  26. {
  27. return [
  28. 'name'=>'required|unique:yz_admin_roles,name,'.$this->get('id').'|max:255',
  29. ];
  30. }
  31. }