27 lines
661 B
PHP
27 lines
661 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Management;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreTakenTransactionRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()?->hasRole('Admin') === true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'quantity' => ['required', 'integer', 'min:1', 'max:9999'],
|
|
'taken_at' => ['nullable', 'date'],
|
|
'taken_by_name' => ['required', 'string', 'max:255'],
|
|
'notes' => ['nullable', 'string', 'max:2000'],
|
|
];
|
|
}
|
|
}
|