33 lines
694 B
PHP
33 lines
694 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\Contacts;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class DestroyContactsRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Prepare the data for validation.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->merge([
|
|
'contactUuidList' => \collect($this->contactUuidList)->filter()->all(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'contactUuidList' => 'present|array|min:0',
|
|
'contactUuidList.*' => 'uuid',
|
|
];
|
|
}
|
|
}
|