ldc-com-app-bo/app/Http/Requests/Api/Contacts/DestroyContactsRequest.php

45 lines
908 B
PHP
Raw Normal View History

<?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([
2023-08-29 11:39:46 +02:00
'contactUuidList' => \collect($this->contactUuidList)->filter()->all()
]);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
2023-08-29 14:02:39 +02:00
'contactUuidList' => 'present|array|min:0',
'contactUuidList.*' => 'uuid',
];
}
}