34 lines
735 B
PHP
34 lines
735 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Bo\Ajax;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class MoveMediaRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return auth()->check() and $this->ajax();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array<string, mixed>
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'dossier_id' => 'required|numeric',
|
||
|
|
'mediaList' => 'required|array',
|
||
|
|
'mediaList.*' => 'required|array',
|
||
|
|
'mediaList.*.id' => 'required|exists:media,id',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|