Server : Apache System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64 User : tradze ( 1001) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/tradze/public_html/app/Modules/Vouchers/Http/Requests/ |
<?php
/**
* Created by Concept24
* User: concept24
*/
namespace App\Modules\Vouchers\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class VoucherOfferRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string',
'buy' => 'required|numeric|min:1',
'bonus' => 'required|numeric|min:0',
'service_id' => 'required',
'usage_limit' => 'required|numeric|min:0|max:365',
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Customize messages
* @return array
*/
public function messages()
{
return [
'name.required' => trans('vouchers::offers.message_error_name_required'),
'buy.required' => trans('vouchers::offers.message_error_buy_required'),
'buy.numeric' => trans('vouchers::offers.message_error_buy_numeric'),
'buy.min' => trans('vouchers::offers.message_error_buy_min'),
'buy.max' => trans('vouchers::offers.message_error_buy_max'),
'bonus.required' => trans('vouchers::offers.message_error_bonus_required'),
'bonus.numeric' => trans('vouchers::offers.message_error_bonus_numeric'),
'bonus.min' => trans('vouchers::offers.message_error_bonus_min'),
'bonus.max' => trans('vouchers::offers.message_error_bonus_max'),
'service_id.required' => trans('vouchers::offers.message_error_service_id_required'),
];
} //end method
}