Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update relasi database dan seed #20

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .env.example
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ APP_KEY=base64:rN3vXWFRHDKFP2sMySe9f4gna7WulisoXTqn7Yo4Ye8=
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://demo.opendk.my.id/
KD_DEFAULT_PROFIL=1107062
KD_DEFAULT_PROFIL=11.01

DB_CONNECTION=mysql
DB_HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ yarn-error.log
.env
composer.lock
composer.log
/storage/installed
/vendor/*
4 changes: 3 additions & 1 deletion app/Http/Controllers/Dashboard/DashboardProfilController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public function showProfile()
$dokumen = DB::table('das_form_dokumen')->take(5)->get();

$page_title = 'Profil';
$page_description = null;

if(isset($profil)){
$page_description= ucwords(strtolower('Kecamatan '.$profil->kecamatan->nama));
$page_description = ucwords(strtolower('Kecamatan '.$profil->kecamatan->nama));
}

return view('dashboard.profil.show_profil', compact('page_title', 'page_description', 'profil', 'defaultProfil', 'dokumen'));
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Data/DataUmumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ public function index()
/* $page_title = 'Data Umum';
$page_description = 'Data Umum Kecamatan';
return view('data.data_umum.index', compact('page_title', 'page_description'));*/
$data_umum = DataUmum::where('kecamatan_id', config('app.default_profile'))->first();
$data_umum = DataUmum::with('kecamatan')->where('kecamatan_id', config('app.default_profile'))->first();
$page_title = 'Ubah Data Umum';
$page_description = 'Kecamatan '. ucwords(strtolower($data_umum->kecamatan->nama));

return view('data.data_umum.edit', compact('page_title', 'page_description', 'data_umum'));
}

Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Data/ProfilController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public function index()
/*$page_title = 'Profil';
$page_description= 'Data Profil Kecamatan';
return view('data.profil.index', compact('page_title', 'page_description'));*/
$profil = Profil::where('kecamatan_id', config('app.default_profile'))->first();
$profil = Profil::with('kecamatan')->where('kecamatan_id', config('app.default_profile'))->first();
// dd($profil);
if($profil->file_struktur_organisasi == ''){
$profil->file_struktur_organisasi = 'http://placehold.it/600x400';
}
Expand Down
5 changes: 3 additions & 2 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'modes' => [],
],

'pgsql' => [
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/DasDataUmumTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function run()
array (
'id' => 1,
'profil_id' => 1,
'kecamatan_id' => '13.07.04',
'kecamatan_id' => '11.01',
'tipologi' => 'Kecamatan maju namun terpencil.',
'ketinggian' => 1,
'luas_wilayah' => 0.0,
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/DasProfilTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function run()
'id' => 1,
'provinsi_id' => '13',
'kabupaten_id' => '1308',
'kecamatan_id' => '1308020',
'kecamatan_id' => '11.01',
'alamat' => 'Jl. Koperasi No. 1, Kab Lombok Barat, Provinsi Nusa Tenggara Barat',
'kode_pos' => '83653',
'telepon' => '021-2345234',
Expand Down
Loading