2023-07-02 13:40:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
|
|
|
|
class SetupRequest extends FormRequest
|
|
|
|
{
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return Gate::allows( 'admin');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules(Request $request)
|
|
|
|
{
|
|
|
|
if (! $request->isMethod('post'))
|
|
|
|
return [];
|
|
|
|
|
|
|
|
return [
|
|
|
|
'system_id' => 'required|exists:systems,id',
|
|
|
|
'binkp' => 'nullable|array',
|
|
|
|
'binkp.*' => 'nullable|numeric',
|
2023-07-05 12:42:59 +00:00
|
|
|
'dns' => 'nullable|array',
|
2023-07-02 13:40:08 +00:00
|
|
|
'dns.*' => 'nullable|numeric',
|
2023-07-05 12:42:59 +00:00
|
|
|
'emsi' => 'nullable|array',
|
2023-07-02 13:40:08 +00:00
|
|
|
'emsi.*' => 'nullable|numeric',
|
|
|
|
'*_bind' => 'required|ip',
|
|
|
|
'*_port' => 'required|numeric',
|
2023-07-05 12:42:59 +00:00
|
|
|
'*_active' => 'nullable|accepted',
|
2023-07-02 13:40:08 +00:00
|
|
|
'options' => 'nullable|array',
|
|
|
|
'options.*' => 'nullable|numeric',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|