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

45 lines
879 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([
'contacts' => \collect($this->ids)->filter()->all()
]);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'contacts' => 'required|array',
'contacts.*' => 'required|uuid',
];
}
}