mirror of
https://github.com/v2board/v2board.git
synced 2024-11-13 11:09:11 +08:00
update: add payment save request validate
This commit is contained in:
parent
90211c1018
commit
37a6f3861c
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\Admin\PaymentSave;
|
||||||
use App\Services\PaymentService;
|
use App\Services\PaymentService;
|
||||||
use App\Utils\Helper;
|
use App\Utils\Helper;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -40,7 +41,7 @@ class PaymentController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save(Request $request)
|
public function save(PaymentSave $request)
|
||||||
{
|
{
|
||||||
if (!config('v2board.app_url')) {
|
if (!config('v2board.app_url')) {
|
||||||
abort(500, '请在站点配置中配置站点地址');
|
abort(500, '请在站点配置中配置站点地址');
|
||||||
|
31
app/Http/Requests/Admin/PaymentSave.php
Normal file
31
app/Http/Requests/Admin/PaymentSave.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class PaymentSave extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => 'required',
|
||||||
|
'payment' => 'required',
|
||||||
|
'config' => 'required'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name.required' => '显示名称不能为空',
|
||||||
|
'payment.required' => '网关参数不能为空',
|
||||||
|
'config.required' => '配置参数不能为空'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user