<?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' => 'required|string|min:4|max:8',
			'ticpass' => 'required|string|min:4',
			'fixpass' => 'required|string|min:4',
		];
	}
}