Files
unifiedpayment/app/Http/Requests/CollectPaymentsRequest.php
2025-11-26 21:45:45 +00:00

47 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CollectPaymentsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
public function messages(){
return array(
'channel.required' => 'You need to specify the channel',
'wallet_id.required' => 'You need to specify the borker',
'refID.required' => 'No reference ID found',
);
}
public function responsenn(array $errors){
// Always return JSON.
return response()->json($errors, 422);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'msisdn' => 'required|regex:/\d{10}$/',
'amount' => 'required',
'channel' => 'required', //web, ussd, mobile app
'refID' => 'required',
'wallet_id' => 'required',
];
}
}