ldc-gen-game-web/app/Http/Requests/SaveBannedIpListRequest.php

35 lines
672 B
PHP
Raw Permalink Normal View History

2022-01-10 16:58:25 +01:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
2022-03-15 16:27:41 +01:00
class SaveBannedIpListRequest extends FormRequest
2022-01-10 16:58:25 +01:00
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
2022-03-15 16:27:41 +01:00
$this->merge([
'ips' => \is_array($this->ips) ? $this->ips : []
]);
return auth('web')->check();
2022-01-10 16:58:25 +01:00
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
2022-03-15 16:27:41 +01:00
'ips' => 'required|array',
'ips.*' => 'required|ip'
2022-01-10 16:58:25 +01:00
];
}
}