|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
class ValidasiUpdatePeminjaman extends FormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*/
|
|
|
|
public function authorize(): bool
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
|
|
*/
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'peti_id' => 'required|integer', // Pastikan peti_id ada dalam tabel petis
|
|
|
|
'customer_id' => 'required|integer', // Pastikan customer_id ada dalam tabel customers
|
|
|
|
'exit_at' => 'required|date',
|
|
|
|
'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at
|
|
|
|
'warehouse_id' => 'required|integer', // Pastikan warehouse_id ada dalam tabel m_warehouses
|
|
|
|
'exit_warehouse' => 'required|integer',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function messages()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'peti_id.required' => 'Bidang Detail Peti wajib diisi.',
|
|
|
|
'peti_id.integer' => 'Bidang Detail Peti harus berupa angka.',
|
|
|
|
'customer_id.required' => 'Bidang Customer wajib diisi.',
|
|
|
|
'customer_id.integer' => 'Bidang Customer harus berupa angka.',
|
|
|
|
'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.',
|
|
|
|
'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.',
|
|
|
|
'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.',
|
|
|
|
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
|
|
|
|
'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.',
|
|
|
|
'warehouse_id.integer' => 'Bidang Asal Gudang harus berupa angka.',
|
|
|
|
'exit_warehouse.required' => 'Bidang Tujuan Gudang wajib diisi.',
|
|
|
|
'exit_warehouse.integer' => 'Bidang Tujuan Gudang harus berupa angka.',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|