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

31 lines
592 B
PHP
Raw Normal View History

2023-11-17 16:07:28 +01: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
*/
2024-03-20 17:39:24 +01:00
public function authorize(): bool
2023-11-17 16:07:28 +01:00
{
return auth()->check() and $this->ajax();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
2024-03-20 17:39:24 +01:00
public function rules(): array
2023-11-17 16:07:28 +01:00
{
return [
'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048'
];
}
}