MenusRequest.php 961 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: qiuzijian
  5. * Date: 2021-04-15
  6. * Time: 16:01
  7. */
  8. namespace Modules\Admin\Http\Requests;
  9. use Illuminate\Foundation\Http\FormRequest;
  10. class MenusRequest extends FormRequest
  11. {
  12. /**
  13. * Get the validation rules that apply to the request.
  14. *
  15. * @return array
  16. */
  17. public function rules()
  18. {
  19. return [
  20. 'parent_id' => 'numeric', // 父级id
  21. 'icon' => 'alpha_dash', // 图标
  22. 'title' => 'required', // 栏目名称
  23. // 'slug' => 'required|alpha_dash', // 标识
  24. 'path' => 'required|string', // 路由
  25. 'sort' => 'numeric', // 排序
  26. 'show' => 'boolean', // 是否显示
  27. ];
  28. }
  29. /**
  30. * Determine if the user is authorized to make this request.
  31. *
  32. * @return bool
  33. */
  34. public function authorize()
  35. {
  36. return true;
  37. }
  38. }