|
|
|
@ -22,11 +22,25 @@ class ValidasiCreateTransfer extends FormRequest
|
|
|
|
|
public function rules(): array |
|
|
|
|
{ |
|
|
|
|
return [ |
|
|
|
|
'peti_id' => 'nullable', // Optional, peti_id harus ada di tabel petis |
|
|
|
|
'source_warehouse' => 'nullable', // Optional, source_warehouse harus ada di tabel m_warehouses |
|
|
|
|
'destination_warehouse' => 'nullable', // Optional, destination_warehouse harus ada di tabel m_warehouses |
|
|
|
|
'name_customer' => 'nullable', // Optional, name_customer harus ada di tabel customers |
|
|
|
|
'date' => 'nullable', // Optional, harus berupa tanggal |
|
|
|
|
'peti_id' => 'required', // Required, peti_id harus ada di tabel petis |
|
|
|
|
'source_warehouse' => 'required', // Optional, source_warehouse harus ada di tabel m_warehouses |
|
|
|
|
'destination_warehouse' => 'required', // Optional, destination_warehouse harus ada di tabel m_warehouses |
|
|
|
|
'name_customer' => 'required', // Optional, name_customer harus ada di tabel customers |
|
|
|
|
'date' => 'required', // Optional, harus berupa tanggal |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get the error messages for the defined validation rules. |
|
|
|
|
*/ |
|
|
|
|
public function messages(): array |
|
|
|
|
{ |
|
|
|
|
return [ |
|
|
|
|
'peti_id.required' => 'Peti harus diisi', |
|
|
|
|
'source_warehouse.required' => 'Source Warehouse harus diisi', |
|
|
|
|
'destination_warehouse.required' => 'Destination Warehouse harus diisi', |
|
|
|
|
'name_customer.required' => 'Nama Customer harus diisi', |
|
|
|
|
'date.required' => 'Tanggal harus diisi', |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|