ldc-gen-game-web/app/Http/Requests/Bo/BannedIps/UpdateBannedIpRequest.php
2023-12-05 12:33:25 +01:00

35 lines
759 B
PHP

<?php
namespace App\Http\Requests\Bo\BannedIps;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
class UpdateBannedIpRequest extends StoreBannedIpRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return Gate::check('update', $this->route('banned_ip'));
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'ip' => [
'required', 'ip',
Rule::unique('banned_ips', 'ip')
->ignore($this->route('banned_ip')->ip, 'ip')
],
];
}
}