DONE: layout letter with letterhead and footer, notification for newly...
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Activity\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ActivityReportRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$isCreate = $this->isMethod('POST');
|
||||
$isUpdate = $this->isMethod('PUT') || $this->isMethod('PATCH');
|
||||
|
||||
if (! $isCreate && ! $isUpdate) {
|
||||
return [
|
||||
'activity_id' => 'nullable|uuid|exists:activities,id',
|
||||
'report_text' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'activity_id' => 'required|uuid|exists:activities,id',
|
||||
'report_text' => 'required|string',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'activity_id.required' => 'Aktiviti diperlukan.',
|
||||
'activity_id.exists' => 'Aktiviti tidak sah.',
|
||||
'report_text.required' => 'Laporan diperlukan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user