clrghouz/app/Http/Requests/SystemSessionRequest.php
Deon George c9eee48c6a
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 42s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m43s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Enable packet passwords to be optional, configured by the admin in setup
2025-01-29 13:40:54 +11:00

35 lines
896 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
class SystemSessionRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
session()->flash('accordion','session');
return Gate::allows('update_nn',$this->route('o'));
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'zone_id' => 'required|exists:zones,id',
'sespass' => 'required|string|min:4',
'pktpass' => [$this->route('o')->pkt_passwds ? 'required' : 'nullable','string','min:4','max:8'],
'ticpass' => 'required|string|min:4',
'fixpass' => 'required|string|min:4',
];
}
}