Skip to content

Commit

Permalink
Solusi Eror 500 Ketika Klik lihat prosedur
Browse files Browse the repository at this point in the history
  • Loading branch information
vickyrolanda committed Jun 9, 2022
1 parent f019f39 commit abdabcd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Informasi/ProsedurController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function store(ProsedurRequest $request)
$file->move($path, $file_name);

$input['file_prosedur'] = $path . $file_name;
$input['slug'] = str_slug($request->input('judul_prosedur'));
$input['mime_type'] = $file->getClientOriginalExtension();
}

Expand Down Expand Up @@ -131,6 +132,7 @@ public function update(Prosedur $prosedur, ProsedurRequest $request)
$input['file_prosedur'] = $path . $file_name;
$input['mime_type'] = $file->getClientOriginalExtension();
}
$input['slug'] = str_slug($request->input('judul_prosedur'));

$prosedur->update($input);
} catch (\Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Page/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getDataProsedur()

public function showProsedur($nama_prosedur)
{
$prosedur = Prosedur::where('judul_prosedur', str_replace('-', ' ', $nama_prosedur))->first();
$prosedur = Prosedur::where('slug', $nama_prosedur)->first();
$page_title = 'Detail Prosedur :' . $prosedur->judul_prosedur;

return view('pages.unduhan.prosedur_show', compact('page_title', 'prosedur'));
Expand Down
1 change: 1 addition & 0 deletions app/Models/Prosedur.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ class Prosedur extends Model
'judul_prosedur',
'file_prosedur',
'mime_type',
'slug',
];
}

2 comments on commit abdabcd

@vickyrolanda
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#430 ini sudah di perbaikin tetapi harus ada penambahan 1 kolom pada table "das_prosedur" -> Tambahkan Collom "slug - var(250)

@andifahruddinakas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#430 ini sudah di perbaikin tetapi harus ada penambahan 1 kolom pada table "das_prosedur" -> Tambahkan Collom "slug - var(250)

Silahkan ditambah lewat migrasi

Please sign in to comment.