UserProfileRequest.php 725 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Requests;
  3. use Request;
  4. use Illuminate\Foundation\Http\FormRequest;
  5. class UserProfileRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. *
  10. * @return bool
  11. */
  12. public function authorize()
  13. {
  14. return true;
  15. }
  16. /**
  17. * Get the validation rules that apply to the request.
  18. *
  19. * @return array
  20. */
  21. public function rules()
  22. {
  23. return [
  24. 'sex' => 'max:2',
  25. 'birthday' => 'date|nullable',
  26. 'residence' => 'max:50',
  27. 'education' => 'max:10',
  28. 'school' => 'max:50',
  29. 'class' => 'max:20'
  30. ];
  31. }
  32. }