ldc-volena/app/Http/Requests/Bo/UploadFileRequest.php
2023-11-20 10:51:41 +01:00

30 lines
579 B
PHP

<?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()
{
return auth()->check() and $this->ajax();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048'
];
}
}