KTVCentral/app/Http/Requests/SessionRequest.php

33 lines
913 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @OA\Schema(
2025-08-21 18:20:37 +08:00
* schema="SessionRequest",
2025-06-03 17:29:50 +08:00
* required={"branch_name","hostname", "ip"},
* @OA\Property(property="branch_name", type="string", example="測試"),
* @OA\Property(property="hostname", type="string", example="PC101"),
* @OA\Property(property="ip", type="string", example="192.168.XX.XX"),
* )
*/
2025-08-21 18:20:37 +08:00
class SessionRequest extends ApiRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'branch_name' =>'required|string|exists:branches,name',
'hostname' => 'required|string',
'ip' => 'required|string',
2025-08-21 18:20:37 +08:00
'token' => 'nullable|string',
];
}
}