OrderSave.php 740 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Http\Requests\User;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class OrderSave extends FormRequest
  5. {
  6. /**
  7. * Get the validation rules that apply to the request.
  8. *
  9. * @return array
  10. */
  11. public function rules()
  12. {
  13. return [
  14. 'plan_id' => 'required',
  15. 'period' => 'required|in:month_price,quarter_price,half_year_price,year_price,two_year_price,three_year_price,onetime_price,reset_price'
  16. ];
  17. }
  18. public function messages()
  19. {
  20. return [
  21. 'plan_id.required' => __('Plan ID cannot be empty'),
  22. 'period.required' => __('Plan period cannot be empty'),
  23. 'period.in' => __('Wrong plan period')
  24. ];
  25. }
  26. }