44 lines
908 B
PHP
44 lines
908 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\Contacts;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class DestroyContactsRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
// * Check is done with api.token middleware
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Prepare the data for validation.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function prepareForValidation()
|
|
{
|
|
$this->merge([
|
|
'contactUuidList' => \collect($this->contactUuidList)->filter()->all()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'contactUuidList' => 'present|array|min:0',
|
|
'contactUuidList.*' => 'uuid',
|
|
];
|
|
}
|
|
}
|