ldc-legaulois/app/Http/Requests/Bo/UploadFileRequest.php

31 lines
601 B
PHP
Raw Permalink Normal View History

2024-08-30 15:46:52 +02:00
<?php
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
class UploadFileRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
return auth('backend')->check() and $this->ajax();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
return [
'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048'
];
}
}