35 lines
760 B
PHP
35 lines
760 B
PHP
|
<?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',
|
||
|
//'dns' => 'required|array',
|
||
|
'dns.*' => 'nullable|numeric',
|
||
|
//'emsi' => 'required|array',
|
||
|
'emsi.*' => 'nullable|numeric',
|
||
|
'*_bind' => 'required|ip',
|
||
|
'*_port' => 'required|numeric',
|
||
|
'options' => 'nullable|array',
|
||
|
'options.*' => 'nullable|numeric',
|
||
|
];
|
||
|
}
|
||
|
}
|