Commit 2c8282f2 by Bagus Pambudi

halaman download diperbarui

parent 400107c0
...@@ -46,6 +46,7 @@ abstract class StorageRepository ...@@ -46,6 +46,7 @@ abstract class StorageRepository
if ($request->hasFile($tipe)) { if ($request->hasFile($tipe)) {
$cover = $request->file($tipe); $cover = $request->file($tipe);
$extension = $cover->guessClientExtension(); $extension = $cover->guessClientExtension();
$data['slug'] = str_slug($data['title']) . '.' . $extension;
$filename = $data['id'] . '.' . $extension; $filename = $data['id'] . '.' . $extension;
if ($setting['external_storage'] == 1) { if ($setting['external_storage'] == 1) {
Storage::disk('storage')->put($setting['directory'] . '/' . $tipe . '/' . $filename, file_get_contents($cover->getRealPath())); Storage::disk('storage')->put($setting['directory'] . '/' . $tipe . '/' . $filename, file_get_contents($cover->getRealPath()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment