refactored Mpamba Controller, added wallet tables
This commit is contained in:
43
app/Http/Requests/MpambaTnmRequest.php
Normal file
43
app/Http/Requests/MpambaTnmRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MpambaTnmRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
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',
|
||||
// 'refID.unique' => 'Duplicate refID, check and try again'
|
||||
);
|
||||
}
|
||||
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user