From f2618efcfa808a5ea428266490057da8b42a04e3 Mon Sep 17 00:00:00 2001 From: Yogi Perdana Date: Thu, 29 Jun 2023 19:55:29 +0700 Subject: [PATCH] Penyesuaian slug tidak berubah ketika di edit pada kategori komplain (#722) * Penyesuaian slug tidak berubah ketika di edit pada kategori komplain * Fix styling * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: yogiperdana Co-authored-by: vickyrolanda --- .../Setting/KategoriKomplainController.php | 1 - app/Models/KategoriKomplain.php | 17 +++++++++++++++++ catatan_rilis.md | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Setting/KategoriKomplainController.php b/app/Http/Controllers/Setting/KategoriKomplainController.php index 5e855ab5b..b9a54cd48 100755 --- a/app/Http/Controllers/Setting/KategoriKomplainController.php +++ b/app/Http/Controllers/Setting/KategoriKomplainController.php @@ -77,7 +77,6 @@ public function store(Request $request) try { $kategori = new KategoriKomplain($request->all()); - $kategori->slug = str_slug($kategori->nama); $kategori->save(); } catch (\Exception $e) { report($e); diff --git a/app/Models/KategoriKomplain.php b/app/Models/KategoriKomplain.php index f8c640e79..a4d28f550 100755 --- a/app/Models/KategoriKomplain.php +++ b/app/Models/KategoriKomplain.php @@ -31,13 +31,30 @@ namespace App\Models; +use Cviebrock\EloquentSluggable\Sluggable; use Illuminate\Database\Eloquent\Model; class KategoriKomplain extends Model { + use Sluggable; + protected $table = 'das_kategori_komplain'; protected $fillable = [ 'nama' ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'nama', + ], + ]; + } } diff --git a/catatan_rilis.md b/catatan_rilis.md index 0716efb25..261b7268f 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -8,6 +8,7 @@ Di rilis v2306.0.0 berisi perbaikan yang diminta Komunitas OpenDK. 2. [#503](https://github.com/OpenSID/OpenDK/issues/503) Perbaikan fitur keluhan web dan admin. 3. [#714](https://github.com/OpenSID/OpenDK/issues/714) Perbaikan gambar image not found tidak muncul ketika tidak ada gambar pada modul potensi. 4. [#708](https://github.com/OpenSID/OpenDK/issues/708) Perbaikan validasi client-side pada form dokumen. +5. [#710](https://github.com/OpenSID/OpenDK/issues/710) Perbaikan slug tidak berubah ketika di edit pada kategori komplain. #### Teknis