Gunawan19621
1 year ago
27 changed files with 410 additions and 261 deletions
@ -0,0 +1,45 @@
|
||||
<?php |
||||
|
||||
namespace App\Http\Requests; |
||||
|
||||
use Illuminate\Foundation\Http\FormRequest; |
||||
|
||||
class ValidasiCreatePeminjaman 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 |
||||
'exit_at' => 'required|date', |
||||
'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at |
||||
'exit_warehouse' => 'required|integer', |
||||
]; |
||||
} |
||||
|
||||
public function messages() |
||||
{ |
||||
return [ |
||||
'peti_id.required' => 'Bidang Detail Peti wajib diisi.', |
||||
'peti_id.integer' => 'Detail Peti 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.', |
||||
'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', |
||||
'exit_warehouse.integer' => 'Asal Gudang harus berupa angka.', |
||||
]; |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
<?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 |
||||
'exit_at' => 'required|date', |
||||
'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at |
||||
'exit_warehouse' => 'required|integer', |
||||
]; |
||||
} |
||||
|
||||
public function messages() |
||||
{ |
||||
return [ |
||||
'peti_id.required' => 'Bidang Detail Peti wajib diisi.', |
||||
'peti_id.integer' => 'Detail Peti 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.', |
||||
'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', |
||||
'exit_warehouse.integer' => 'Asal Gudang harus berupa angka.', |
||||
]; |
||||
} |
||||
} |
@ -0,0 +1,54 @@
|
||||
<?php |
||||
|
||||
namespace App\Http\Requests; |
||||
|
||||
use Illuminate\Foundation\Http\FormRequest; |
||||
|
||||
class ValidasiUpdatePengembalian 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', |
||||
'exit_at' => 'required|date', |
||||
'est_pengembalian' => 'required|date', |
||||
'exit_warehouse' => 'required|integer', |
||||
'enter_at' => 'required|date', |
||||
'enter_warehouse' => 'required|integer', |
||||
'kondisi_peti' => 'required|string', |
||||
]; |
||||
} |
||||
|
||||
public function messages() |
||||
{ |
||||
return [ |
||||
'peti_id.required' => 'Kolom peti_id wajib diisi.', |
||||
'peti_id.integer' => 'Kolom peti_id harus berupa angka bulat.', |
||||
'exit_at.required' => 'Kolom exit_at wajib diisi.', |
||||
'exit_at.date' => 'Kolom exit_at harus berupa tanggal.', |
||||
'est_pengembalian.required' => 'Kolom est_pengembalian wajib diisi.', |
||||
'est_pengembalian.date' => 'Kolom est_pengembalian harus berupa tanggal.', |
||||
'exit_warehouse.required' => 'Kolom exit_warehouse wajib diisi.', |
||||
'exit_warehouse.integer' => 'Kolom exit_warehouse harus berupa angka bulat.', |
||||
'enter_at.required' => 'Kolom enter_at wajib diisi.', |
||||
'enter_at.date' => 'Kolom enter_at harus berupa tanggal.', |
||||
'enter_warehouse.required' => 'Kolom enter_warehouse wajib diisi.', |
||||
'enter_warehouse.integer' => 'Kolom enter_warehouse harus berupa angka bulat.', |
||||
'kondisi_peti.required' => 'Kolom kondisi_peti wajib diisi.', |
||||
'kondisi_peti.string' => 'Kolom kondisi_peti harus berupa teks.', |
||||
]; |
||||
} |
||||
} |
Loading…
Reference in new issue