33 lines
913 B
PHP
33 lines
913 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* @OA\Schema(
|
|
* schema="SessionRequest",
|
|
* 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"),
|
|
* )
|
|
*/
|
|
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',
|
|
'token' => 'nullable|string',
|
|
];
|
|
}
|
|
}
|