DONE: layout letter with letterhead and footer, notification for newly...
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MembershipApplication\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UploadMembershipApplicationDocumentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'type' => ['required', Rule::in(['ic_copy', 'photo', 'salary_slip', 'employer_letter'])],
|
||||
'file' => [
|
||||
'required',
|
||||
'file',
|
||||
'max:10240',
|
||||
Rule::when(
|
||||
$this->input('type') === 'photo',
|
||||
'mimes:jpg,jpeg,png',
|
||||
'mimes:pdf,jpg,jpeg,png',
|
||||
),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'type.required' => 'Jenis dokumen diperlukan.',
|
||||
'type.in' => 'Jenis dokumen tidak sah.',
|
||||
'file.required' => 'Fail diperlukan.',
|
||||
'file.mimes' => 'Format fail tidak disokong.',
|
||||
'file.max' => 'Saiz fail melebihi had maksimum 10MB.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user