dress/app/Http/Requests/Admin/Finance/ExpenseRequest.php

31 lines
689 B
PHP

<?php
namespace App\Http\Requests\Admin\Finance;
use Illuminate\Foundation\Http\FormRequest;
class ExpenseRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:100'],
'amount' => ['required', 'numeric', 'min:0'],
'image' => ['nullable', 'image', 'max:5120'],
];
}
}