PermissionCreateRequest.php 688 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: dingran
  5. * Date: 2019/3/10
  6. * Time: 下午12:52
  7. */
  8. namespace app\platform\modules\user\requests;
  9. class PermissionCreateRequest 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_permissions|max:255',
  29. 'label'=>'required|max:255',
  30. 'parent_id'=>'required|int',
  31. ];
  32. }
  33. }