34 lines
672 B
PHP
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'
|
|
];
|
|
}
|
|
}
|