You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
<?php |
|
|
|
namespace App\Http\Requests\Disposal; |
|
|
|
use Illuminate\Foundation\Http\FormRequest; |
|
|
|
class ValidasiUpdateDisposal 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', |
|
'customer_id' => 'required|integer', |
|
'warehouse_id' => 'required|integer', |
|
'date_disposal' => 'nullable|date', |
|
'description' => 'nullable|string', |
|
'status_disposal' => 'nullable', |
|
]; |
|
} |
|
|
|
public function messages(): array |
|
{ |
|
return [ |
|
'peti_id.required' => 'Peti harus dipilih.', |
|
'peti_id.integer' => 'Peti harus berupa angka.', |
|
'customer_id.required' => 'Customer harus dipilih.', |
|
'customer_id.integer' => 'Customer harus berupa angka.', |
|
'warehouse_id.required' => 'Gudang harus dipilih.', |
|
'warehouse_id.integer' => 'Gudang harus berupa angka.', |
|
'date_disposal.date' => 'Format tanggal disposal tidak valid.', |
|
'description.string' => 'Deskripsi harus berupa teks.', |
|
]; |
|
} |
|
}
|
|
|