From 239b83606b3b0e02bc140ec00e60a946d009daa8 Mon Sep 17 00:00:00 2001 From: Anang Novriadi Date: Mon, 8 Jul 2024 19:22:00 +0700 Subject: [PATCH 1/5] Penambahan unduh data penduduk (#979) --- app/Exports/ExportPenduduk.php | 60 +++++++++++++++++++ .../Controllers/Data/PendudukController.php | 18 ++++++ catatan_rilis.md | 27 ++------- resources/views/data/penduduk/index.blade.php | 7 ++- routes/web.php | 1 + 5 files changed, 90 insertions(+), 23 deletions(-) create mode 100644 app/Exports/ExportPenduduk.php diff --git a/app/Exports/ExportPenduduk.php b/app/Exports/ExportPenduduk.php new file mode 100644 index 000000000..dbdf42006 --- /dev/null +++ b/app/Exports/ExportPenduduk.php @@ -0,0 +1,60 @@ +get(); + + foreach ($penduduks as $penduduk) { + array_push($data, (object)[ + 'id' => $penduduk->id, + 'nama' => $penduduk->nama, + 'nik' => $penduduk->nik, + 'no_kk' => $penduduk->no_kk, + 'nama_desa' => $penduduk->desa->nama, + 'alamat' => $penduduk->alamat, + 'pendidikan' => $penduduk->pendidikan_kk->nama, + 'tanggal_lahir' => $penduduk->tanggal_lahir, + 'pekerjaan' => $penduduk->pekerjaan->nama, + 'status_kawin' => $penduduk->pekerjaan->nama, + ]); + } + + return collect($data); + } + + /** + * @return array + */ + public function headings(): array + { + return [ + 'ID', + 'NAMA', + 'NIK', + 'NO.KK', + 'DESA', + 'ALAMAT', + 'PENDIDIKAN DALAM KK', + 'TANGGAL LAHIR', + 'PEKERJAAN', + 'STATUS KAWIN' + ]; + } +} diff --git a/app/Http/Controllers/Data/PendudukController.php b/app/Http/Controllers/Data/PendudukController.php index a0ac526c9..2a4608c7e 100644 --- a/app/Http/Controllers/Data/PendudukController.php +++ b/app/Http/Controllers/Data/PendudukController.php @@ -31,6 +31,8 @@ namespace App\Http\Controllers\Data; +use Maatwebsite\Excel\Facades\Excel; + use App\Http\Controllers\Controller; use App\Imports\ImporPendudukKeluarga; use App\Models\DataDesa; @@ -39,6 +41,7 @@ use Illuminate\Http\Response; use Illuminate\Support\Facades\DB; use Yajra\DataTables\DataTables; +use App\Exports\ExportPenduduk; class PendudukController extends Controller { @@ -177,4 +180,19 @@ public function importExcel(Request $request) return redirect()->route('data.penduduk.index')->with('success', 'Import data sukses.'); } + + /** + * Export data penduduk ke dalam file Excel. + * + * @return Response + */ + public function exportExcel(Penduduk $penduduk) { + try { + return Excel::download(new ExportPenduduk, 'data-penduduk.xlsx'); + } catch (\Exception $e) { + report($e); + + return back()->with('error', 'Export data gagal. '.$e->getMessage()); + } + } } diff --git a/catatan_rilis.md b/catatan_rilis.md index 092a090db..a26665c2d 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -1,34 +1,17 @@ -Di rilis versi v2407.0.0 di versi ini terdapat modul themes dan perbaikan lain yang diminta Komunitas. +Di rilis versi v2407.0.1 di versi ini [untuk diisi] dan perbaikan lain yang diminta Komunitas. -Terima kasih pada @arifpriadi dan @nyomanjyotisa telah ikut berkontribusi. +Terima kasih pada [untuk diisi] telah ikut berkontribusi. #### FITUR -1. [#262](https://github.com/OpenSID/OpenDK/issues/262) Penambahan modul themes. -2. [#960](https://github.com/OpenSID/OpenDK/issues/960) Penambahan filter berdasarkan desa pada modul berkaitan dengan data desa. -3. [#962](https://github.com/OpenSID/OpenDK/issues/962) Penambahan unduh dan lihat pada halaman unduhan dokumen website. -4. [#958](https://github.com/OpenSID/OpenDK/issues/958) Penambahan informasi jika jenis penyakit belum tersedia pada modul epidemi penyakit. -5. [#959](https://github.com/OpenSID/OpenDK/issues/959) Penambahan informasi jika tipe potensi belum tersedia pada modul potensi. -6. [#640](https://github.com/OpenSID/OpenDK/issues/640) Penambahan halaman web tipologi. +1. [#399](https://github.com/OpenSID/OpenDK/issues/399) Penambahan unduh data penduduk. #### BUG -1. [#930](https://github.com/OpenSID/OpenDK/issues/930) Perbaikan link email pada halaman website. -2. [#934](https://github.com/OpenSID/OpenDK/issues/934) Perbaikan tampilan widget pegawai kecamatan. -3. [#927](https://github.com/OpenSID/OpenDK/issues/927) Perbaikan keterangan gagal impor jika desa tidak terdaftar. -4. [#963](https://github.com/OpenSID/OpenDK/issues/963) Perbaikan slug pada menu. -5. [#961](https://github.com/OpenSID/OpenDK/issues/961) Perbaikan ubah profil saat data desa sudah ada. -6. [#966](https://github.com/OpenSID/OpenDK/issues/966) Perbaikan order pada modul pengurus. -7. [#967](https://github.com/OpenSID/OpenDK/issues/967) Perbaikan order pada modul jabatan. +1. #### TEKNIS -1. [#845](https://github.com/OpenSID/OpenDK/issues/845) Penggunaan laravel pint. -2. [#957](https://github.com/OpenSID/OpenDK/issues/957) Penyesuaian carbon menggunakan bawaan laravel. -3. [#968](https://github.com/OpenSID/OpenDK/issues/968) Penyesuaian modul regulasi menggunakan datatable. -4. [#969](https://github.com/OpenSID/OpenDK/issues/969) Penyesuaian modul potensi menggunakan datatable. -5. [#965](https://github.com/OpenSID/OpenDK/issues/965) Penyesuaian seeders dan factories. -6. [#964](https://github.com/OpenSID/OpenDK/issues/964) Penyesuaian Lang (bahasa) yang tidak digunakan. -7. [#970](https://github.com/OpenSID/OpenDK/issues/970) Penyesuaian modul event menggunakan datatable. \ No newline at end of file +1. \ No newline at end of file diff --git a/resources/views/data/penduduk/index.blade.php b/resources/views/data/penduduk/index.blade.php index 32a7f33e0..88be7a84b 100644 --- a/resources/views/data/penduduk/index.blade.php +++ b/resources/views/data/penduduk/index.blade.php @@ -25,7 +25,12 @@
+
diff --git a/routes/web.php b/routes/web.php index 518515636..d276cb882 100644 --- a/routes/web.php +++ b/routes/web.php @@ -379,6 +379,7 @@ Route::get('show/{id}', ['as' => 'data.penduduk.show', 'uses' => 'PendudukController@show']); Route::get('import', ['as' => 'data.penduduk.import', 'uses' => 'PendudukController@import']); Route::post('import-excel', ['as' => 'data.penduduk.import-excel', 'uses' => 'PendudukController@importExcel']); + Route::get('export-excel', ['as' => 'data.penduduk.export-excel', 'uses' => 'PendudukController@exportExcel']); }); // Keluarga From 23e0197bb6ee65c676b0ccb334d24cda5eb69fb6 Mon Sep 17 00:00:00 2001 From: Saifuddin Mutammam Date: Fri, 19 Jul 2024 10:40:39 +0700 Subject: [PATCH 2/5] Penambahan modul navigasi halaman publik (#978) --- app/Http/Controllers/Controller.php | 10 +- app/Http/Controllers/FrontEndController.php | 15 ++ .../Setting/NavigationController.php | 245 ++++++++++++++++++ app/Http/Requests/NavigationRequest.php | 61 +++++ app/Models/Navigation.php | 75 ++++++ catatan_rilis.md | 4 +- ..._07_01_101314_create_navigations_table.php | 71 +++++ database/seeders/DasNavigationTableSeeder.php | 239 +++++++++++++++++ database/seeders/DatabaseSeeder.php | 1 + helpers/general_helper.php | 1 + .../views/layouts/fragments/sidebar.blade.php | 3 + .../views/layouts/frontends/header.blade.php | 142 +++++----- .../views/setting/navigation/create.blade.php | 56 ++++ .../views/setting/navigation/edit.blade.php | 56 ++++ .../views/setting/navigation/form.blade.php | 26 ++ .../views/setting/navigation/index.blade.php | 101 ++++++++ routes/web.php | 15 +- 17 files changed, 1038 insertions(+), 83 deletions(-) create mode 100644 app/Http/Controllers/Setting/NavigationController.php create mode 100644 app/Http/Requests/NavigationRequest.php create mode 100644 app/Models/Navigation.php create mode 100644 database/migrations/2024_07_01_101314_create_navigations_table.php create mode 100644 database/seeders/DasNavigationTableSeeder.php create mode 100644 resources/views/setting/navigation/create.blade.php create mode 100644 resources/views/setting/navigation/edit.blade.php create mode 100644 resources/views/setting/navigation/form.blade.php create mode 100644 resources/views/setting/navigation/index.blade.php diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 9abffa53a..4cdde2e75 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -38,6 +38,7 @@ use App\Models\Jabatan; use App\Models\Keluarga; use App\Models\MediaSosial; +use App\Models\Navigation; use App\Models\Penduduk; use App\Models\Pengurus; use App\Models\Profil; @@ -132,27 +133,20 @@ public function __construct() // TODO : Gunakan untuk semua pengaturan jika sudah tersedia $this->browser_title = SettingAplikasi::where('key', 'judul_aplikasi')->first()->value ?? ucwords($this->sebutan_wilayah.' '.$this->profil->nama_kecamatan); - $events = Event::getOpenEvents(); - $sinergi = SinergiProgram::where('status', 1)->orderBy('urutan', 'asc')->get(); - $medsos = MediaSosial::where('status', 1)->get(); $navdesa = DataDesa::all(); $navpotensi = TipePotensi::orderby('nama_kategori', 'ASC')->get(); $pengurus = Pengurus::status()->get(); - $slides = Slide::orderBy('created_at', 'DESC')->get(); + View::share([ 'profil' => $this->profil, 'sebutan_wilayah' => $this->sebutan_wilayah, 'sebutan_kepala_wilayah' => $this->sebutan_kepala_wilayah, 'browser_title' => $this->browser_title, - 'events' => $events, - 'sinergi' => $sinergi, - 'medsos' => $medsos, 'navdesa' => $navdesa, 'navpotensi' => $navpotensi, 'camat' => $this->nama_camat, 'pengurus' => $pengurus->sortBy('jabatan.jenis'), - 'slides' => $slides, ]); } } diff --git a/app/Http/Controllers/FrontEndController.php b/app/Http/Controllers/FrontEndController.php index 63f2aa14a..94fc40525 100644 --- a/app/Http/Controllers/FrontEndController.php +++ b/app/Http/Controllers/FrontEndController.php @@ -31,11 +31,26 @@ namespace App\Http\Controllers; +use App\Models\Event; +use App\Models\Slide; +use App\Models\Navigation; +use App\Models\MediaSosial; +use App\Models\SinergiProgram; +use Illuminate\Support\Facades\View; + class FrontEndController extends Controller { public function __construct() { parent::__construct(); theme_active(); + + View::share([ + 'events' => Event::getOpenEvents(), + 'medsos' => MediaSosial::where('status', 1)->get(), + 'navigations' => Navigation::with('childrens')->whereNull('parent_id')->where('status', 1)->orderBy('order', 'asc')->get(), + 'sinergi' => SinergiProgram::where('status', 1)->orderBy('urutan', 'asc')->get(), + 'slides' => Slide::orderBy('created_at', 'DESC')->get(), + ]); } } diff --git a/app/Http/Controllers/Setting/NavigationController.php b/app/Http/Controllers/Setting/NavigationController.php new file mode 100644 index 000000000..c611b854d --- /dev/null +++ b/app/Http/Controllers/Setting/NavigationController.php @@ -0,0 +1,245 @@ +name; + $prev_parent = $navigation->parent_id; + } + + return view('setting.navigation.index', compact('page_title', 'page_description', 'parent_id', 'prev_parent')); + } + + // Get Data Navigasi + public function getData($parent_id = null) + { + $query = Navigation::when($parent_id, function ($query) use ($parent_id) { + return $query->where('parent_id', $parent_id); + })->orderBy('order', 'asc'); + + return DataTables::of($query) + ->addColumn('aksi', function ($row) { + if (! auth()->guest()) { + $data['edit_url'] = route('setting.navigation.edit', $row->id); + $data['delete_url'] = route('setting.navigation.destroy', $row->id); + $data['detail_url'] = route('setting.navigation.index', $row->id); + $data['naik'] = route('setting.navigation.order', [$row->id, 'up']); + $data['turun'] = route('setting.navigation.order', [$row->id, 'down']); + } + + return view('forms.aksi', $data); + }) + ->make(); + } + + /** + * Show the form for creating a new resource. + * + * @return Response + */ + public function create($parent_id = 0) + { + $page_title = 'Navigasi'; + $page_description = 'Tambah Navigasi'; + + return view('setting.navigation.create', compact('page_title', 'page_description', 'parent_id')); + } + + /** + * Store a newly created resource in storage. + * + * @return Response + */ + public function store(NavigationRequest $request) + { + $parent_id = $request->input('parent_id'); + + try { + + $data = $request->all(); + + // generate slug + $parent = Navigation::where('id', $parent_id)->first(); + $data['slug'] = (!empty($parent)) ? $parent->slug . "-" . Str::slug($data['name']) : Str::slug($data['name']); + + // set latest order + $data['order'] = Navigation::lastOrder($parent_id) + 1; + $navigation = new Navigation($data); + $navigation->save(); + } catch (\Exception $e) { + report($e); + + return back()->withInput()->with('error', 'Navigasi gagal dikirim!'); + } + + return redirect()->route('setting.navigation.index', $parent_id)->with('success', 'Navigasi berhasil dikirim!'); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return Response + */ + public function edit($id) + { + $navigation = Navigation::findOrFail($id); + $page_title = 'Navigasi'; + $page_description = 'Ubah Navigasi : '.$navigation->name; + $parent_id = $navigation->parent_id; + + return view('setting.navigation.edit', compact('page_title', 'page_description', 'navigation', 'parent_id')); + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * @return Response + */ + public function update(NavigationRequest $request, $id) + { + $parent_id = $request->input('parent_id'); + + try { + $data = $request->all(); + + // generate slug + $parent = Navigation::where('id', $parent_id)->first(); + $data['slug'] = (!empty($parent)) ? $parent->slug . "-" . Str::slug($data['name']) : Str::slug($data['name']); + + $navigation = Navigation::findOrFail($id); + $navigation->fill($data); + $navigation->save(); + } catch (\Exception $e) { + report($e); + + return back()->withInput()->with('error', 'Navigasi gagal diupdate!'); + } + + return redirect()->route('setting.navigation.index', $parent_id)->with('success', 'Navigasi berhasil diupdate!'); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return Response + */ + public function destroy($id) + { + try { + // delete childs + Navigation::where('parent_id', $id)->delete(); + + $navigation = Navigation::findOrFail($id); + $navigation->delete(); + + $parent_id = $navigation->parent_id; + } catch (\Exception $e) { + report($e); + + return back()->withInput()->with('error', 'Navigasi gagal dihapus!'); + } + + return redirect()->route('setting.navigation.index', $parent_id)->with('success', 'Navigasi berhasil dihapus!'); + } + + /** + * Order the specified resource from storage. + * + * @param int $id + * @param string $direction + * @return Response + */ + public function order($id, $direction) + { + try { + $navigation = Navigation::findOrFail($id); + $parent_id = $navigation->parent_id; + + $current_order = $navigation->order; + if ($direction === 'up') { + $new_order = $current_order - 1; + + $lower_navigation = Navigation::where('parent_id', $parent_id)->where('order', $new_order)->first(); + if (!empty($lower_navigation)) { + $lower_navigation->order = $current_order; + $lower_navigation->save(); + + $navigation->order = $new_order; + $navigation->save(); + } + } else { + $new_order = $current_order + 1; + + $higher_navigation = Navigation::where('parent_id', $parent_id)->where('order', $new_order)->first(); + if (!empty($higher_navigation)) { + $higher_navigation->order = $current_order; + $higher_navigation->save(); + + $navigation->order = $new_order; + $navigation->save(); + } + } + + } catch (\Exception $e) { + report($e); + + return back()->withInput()->with('error', 'Navigasi gagal diurutkan!'); + } + + return redirect()->route('setting.navigation.index', $parent_id)->with('success', 'Navigasi berhasil diurutkan!'); + } +} diff --git a/app/Http/Requests/NavigationRequest.php b/app/Http/Requests/NavigationRequest.php new file mode 100644 index 000000000..49633b99a --- /dev/null +++ b/app/Http/Requests/NavigationRequest.php @@ -0,0 +1,61 @@ + 'required', + 'nav_type' => 'required', + 'url' => 'required', + ]; + } +} diff --git a/app/Models/Navigation.php b/app/Models/Navigation.php new file mode 100644 index 000000000..0099b8dca --- /dev/null +++ b/app/Models/Navigation.php @@ -0,0 +1,75 @@ +get(); + } + + public static function lastOrder($parent_id = 0) + { + return static::where('parent_id', $parent_id)->max('order'); + } + + public function parent() + { + return $this->belongsTo(Navigation::class, 'parent_id'); + } + + public function childrens() + { + return $this->hasMany(Navigation::class, 'parent_id'); + } +} diff --git a/catatan_rilis.md b/catatan_rilis.md index a26665c2d..9374b7c2a 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -1,10 +1,10 @@ -Di rilis versi v2407.0.1 di versi ini [untuk diisi] dan perbaikan lain yang diminta Komunitas. +Di rilis versi v2408.0.1 di versi ini [untuk diisi] dan perbaikan lain yang diminta Komunitas. Terima kasih pada [untuk diisi] telah ikut berkontribusi. #### FITUR -1. [#399](https://github.com/OpenSID/OpenDK/issues/399) Penambahan unduh data penduduk. +1. [#511](https://github.com/OpenSID/OpenDK/issues/511) Penambahan modul navigasi halaman publik. #### BUG diff --git a/database/migrations/2024_07_01_101314_create_navigations_table.php b/database/migrations/2024_07_01_101314_create_navigations_table.php new file mode 100644 index 000000000..19c39380a --- /dev/null +++ b/database/migrations/2024_07_01_101314_create_navigations_table.php @@ -0,0 +1,71 @@ +increments('id'); + $table->integer('parent_id')->nullable(); + $table->string('name'); + $table->string('slug')->unique(); + $table->enum('nav_type', ['system', 'external'])->nullable(); + $table->string('url')->nullable(); + $table->integer('order')->nullable(); + $table->tinyInteger('status')->default(0); + + $table->timestamps(); + }); + + Artisan::call('db:seed', ['--class' => 'DasNavigationTableSeeder']); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('das_navigation'); + } +}; diff --git a/database/seeders/DasNavigationTableSeeder.php b/database/seeders/DasNavigationTableSeeder.php new file mode 100644 index 000000000..436f92190 --- /dev/null +++ b/database/seeders/DasNavigationTableSeeder.php @@ -0,0 +1,239 @@ +delete(); + + // insert parents + DB::table('das_navigation')->insert([ + [ + 'name' => 'Beranda', + 'slug' => Str::slug('Beranda'), + 'nav_type' => 'system', + 'url' => '/', + 'order' => 1, + 'status' => 1, + ], + [ + 'name' => 'Berita Desa', + 'slug' => Str::slug('Berita Desa'), + 'nav_type' => 'system', + 'url' => '/berita-desa', + 'order' => 2, + 'status' => 1, + ], + [ + 'name' => 'Profil', + 'slug' => Str::slug('Profil'), + 'nav_type' => 'system', + 'url' => '/#', + 'order' => 3, + 'status' => 1, + ], + [ + 'name' => 'Desa', + 'slug' => Str::slug('Desa'), + 'nav_type' => 'system', + 'url' => '/#', + 'order' => 4, + 'status' => 1, + ], + [ + 'name' => 'Potensi', + 'slug' => Str::slug('Potensi'), + 'nav_type' => 'system', + 'url' => '/#', + 'order' => 5, + 'status' => 1, + ], + [ + 'name' => 'Statistik', + 'slug' => Str::slug('Statistik'), + 'nav_type' => 'system', + 'url' => '/#', + 'order' => 6, + 'status' => 1, + ], + [ + 'name' => 'Unduhan', + 'slug' => Str::slug('Unduhan'), + 'nav_type' => 'system', + 'url' => '/#', + 'order' => 7, + 'status' => 1, + ], + [ + 'name' => 'FAQ', + 'slug' => Str::slug('FAQ'), + 'nav_type' => 'system', + 'url' => '/faq', + 'order' => 8, + 'status' => 1, + ], + ]); + + // insert childs + DB::table('das_navigation')->insert([ + [ + 'parent_id' => Navigation::where('slug', 'profil')->first()->id, + 'name' => 'Sejarah', + 'slug' => 'profil-sejarah', + 'nav_type' => 'system', + 'url' => '/profil/sejarah', + 'order' => 1, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'profil')->first()->id, + 'name' => 'Letak Geografis', + 'slug' => 'profil-letak-geografis', + 'nav_type' => 'system', + 'url' => '/profil/letak-geografis', + 'order' => 2, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'profil')->first()->id, + 'name' => 'Struktur Pemerintahan', + 'slug' => 'profil-struktur-pemerintahan', + 'nav_type' => 'system', + 'url' => '/profil/struktur-pemerintahan', + 'order' => 3, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'profil')->first()->id, + 'name' => 'Visi & Misi', + 'slug' => 'profil-visi-misi', + 'nav_type' => 'system', + 'url' => '/profil/visi-misi', + 'order' => 4, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Penduduk', + 'slug' => 'statistik-penduduk', + 'nav_type' => 'system', + 'url' => '/statistik/kependudukan', + 'order' => 1, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Pendidikan', + 'slug' => 'statistik-pendidikan', + 'nav_type' => 'system', + 'url' => '/statistik/pendidikan', + 'order' => 2, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Kesehatan', + 'slug' => 'statistik-kesehatan', + 'nav_type' => 'system', + 'url' => '/statistik/kesehatan', + 'order' => 3, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Program dan Bantuan', + 'slug' => 'statistik-program-dan-bantuan', + 'nav_type' => 'system', + 'url' => '/statistik/program-dan-bantuan', + 'order' => 4, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Anggaran dan Realisasi', + 'slug' => 'statistik-anggaran-dan-realisasi', + 'nav_type' => 'system', + 'url' => '/statistik/anggaran-dan-realisasi', + 'order' => 5, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, + 'name' => 'Anggaran Desa', + 'slug' => 'statistik-anggaran-desa', + 'nav_type' => 'system', + 'url' => '/statistik/anggaran-desa', + 'order' => 6, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, + 'name' => 'Prosedur', + 'slug' => 'unduhan-prosedur', + 'nav_type' => 'system', + 'url' => '/unduhan/prosedur', + 'order' => 1, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, + 'name' => 'Regulasi', + 'slug' => 'unduhan-regulasi', + 'nav_type' => 'system', + 'url' => '/unduhan/regulasi', + 'order' => 2, + 'status' => 1, + ], + [ + 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, + 'name' => 'Dokumen', + 'slug' => 'unduhan-dokumen', + 'nav_type' => 'system', + 'url' => '/unduhan/form-dokumen', + 'order' => 3, + 'status' => 1, + ] + ]); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index e574fda61..1277e402c 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -68,6 +68,7 @@ public function run() $this->call(RefCoaTableSeeder::class); $this->call(DasMenuTableSeeder::class); $this->call(DasSettingTableSeeder::class); + $this->call(DasNavigationTableSeeder::class); // Other $this->call(DasProfilTableSeeder::class); $this->call(DasDataUmumTableSeeder::class); diff --git a/helpers/general_helper.php b/helpers/general_helper.php index 17d1a232c..88dbfe4f9 100644 --- a/helpers/general_helper.php +++ b/helpers/general_helper.php @@ -30,6 +30,7 @@ */ use App\Models\Menu; +use App\Models\Navigation; use App\Models\Role; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Log; diff --git a/resources/views/layouts/fragments/sidebar.blade.php b/resources/views/layouts/fragments/sidebar.blade.php index eea2489e0..f132d9892 100644 --- a/resources/views/layouts/fragments/sidebar.blade.php +++ b/resources/views/layouts/fragments/sidebar.blade.php @@ -287,6 +287,9 @@