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

27 lines
544 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.
*/
public function authorize(): bool
{
return auth('backend')->check() and $this->ajax();
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
2026-09-25 16:25:31 +02:00
'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048',
2024-08-30 15:46:52 +02:00
];
}
}