clrghouz/app/Http/Requests/SetupRequest.php

36 lines
794 B
PHP
Raw Normal View History

<?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',
'dns.*' => 'nullable|numeric',
2023-07-05 12:42:59 +00:00
'emsi' => 'nullable|array',
'emsi.*' => 'nullable|numeric',
'*_bind' => 'required|ip',
'*_port' => 'required|numeric',
2023-07-05 12:42:59 +00:00
'*_active' => 'nullable|accepted',
'options' => 'nullable|array',
'options.*' => 'nullable|numeric',
];
}
}