ldc-gen-game-web/app/Http/Requests/SaveBannedIpListRequest.php
2022-03-16 10:47:17 +01:00

34 lines
672 B
PHP

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