36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Investment\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ManualInvestmentRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'user_id' => ['required', 'uuid', 'exists:users,id'],
|
|
'investment_type_id' => ['required', 'uuid', 'exists:investment_types,id'],
|
|
'amount' => ['required', 'numeric', 'gt:0'],
|
|
'remarks' => ['nullable', 'string', 'max:1000'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'user_id.required' => 'Ahli diperlukan.',
|
|
'user_id.exists' => 'Ahli tidak dijumpai.',
|
|
'investment_type_id.required' => 'Jenis pelaburan diperlukan.',
|
|
'investment_type_id.exists' => 'Jenis pelaburan tidak dijumpai.',
|
|
'amount.required' => 'Jumlah pelaburan diperlukan.',
|
|
'amount.gt' => 'Jumlah pelaburan mestilah lebih daripada 0.',
|
|
];
|
|
}
|
|
}
|