ldc-gen-game-web/app/Http/Requests/Bo/UpdateWinInfosRequest.php

35 lines
743 B
PHP

<?php
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
class UpdateWinInfosRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
$this->merge([
'done' => $this->done ? true : false,
'comment' => $this->comment ?? ''
]);
return $this->ajax() and auth('web')->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'done' => 'required|boolean',
'comment' => 'required|string|max:255'
];
}
}