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.
44 lines
1.2 KiB
44 lines
1.2 KiB
1 year ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Requests\Disposal;
|
||
|
|
||
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
||
|
class ValidasiCreateDisposal 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' => 'nullable',
|
||
|
'customer_id' => 'nullable',
|
||
|
'warehouse_id' => 'nullable',
|
||
|
'date_disposal' => 'nullable|date',
|
||
|
'description' => 'nullable|string',
|
||
|
'jenis_disposal' => 'nullable|string|max:50',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function messages(): array
|
||
|
{
|
||
|
return [
|
||
|
'date_disposal.date' => 'Format tanggal disposal tidak valid.',
|
||
|
'description.string' => 'Deskripsi harus berupa teks.',
|
||
|
'jenis_disposal.string' => 'Jenis disposal harus berupa teks.',
|
||
|
'jenis_disposal.max' => 'Jenis disposal tidak boleh lebih dari :max karakter.',
|
||
|
];
|
||
|
}
|
||
|
}
|