Attachment system some file

This commit is contained in:
cuneytsenturk
2017-12-28 17:20:16 +03:00
parent 411de05efd
commit 97afc50cfa
16 changed files with 420 additions and 84 deletions

View File

@ -2,6 +2,8 @@
namespace App\Traits;
use MediaUploader;
trait Uploads
{
@ -27,4 +29,17 @@ trait Uploads
return $path;
}
}
public function getMedia($file, $folder, $company_id = null)
{
if (!$company_id) {
$company_id = session('company_id');
}
$path = config('filesystems.disks.uploads.root') . '/' . $company_id . '/' . $folder;
config(['filesystems.disks.uploads.root' => $path]);
return MediaUploader::fromSource($file)->upload();
}
}