Fix Slug Status Permohonan

This commit is contained in:
Daeng Deni Mardaeni 2024-09-19 10:27:02 +07:00
parent 9ecdaa0cdd
commit b0c8a43304

View File

@ -16,6 +16,7 @@
$rules = [ $rules = [
'description' => 'nullable|max:255', 'description' => 'nullable|max:255',
'status' => 'required|boolean', 'status' => 'required|boolean',
'slug' => 'nullable|max:255',
]; ];
if ($this->method() == 'PUT') { if ($this->method() == 'PUT') {
@ -37,9 +38,9 @@
public function prepareForValidation() public function prepareForValidation()
{ {
$this->merge([ return $this->merge([
'status' => isset($this->status) ? 1 : 0, 'status' => isset($this->status) ? 1 : 0,
'slug'=> Str::slug($this->name) 'slug' => Str::slug($this->name),
]); ]);
} }
} }