first commit

This commit is contained in:
denisdulici
2017-09-14 22:21:00 +03:00
commit 515bdaf5cd
598 changed files with 48030 additions and 0 deletions

26
app/Traits/Uploads.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Traits;
trait Uploads
{
public function getUploadedFilePath($file, $folder = 'settings', $company_id = null)
{
$path = '';
if (!$file || !$file->isValid()) {
return $path;
}
if (!$company_id) {
$company_id = session('company_id');
}
$file_name = $file->getClientOriginalName();
$path = 'storage/app/' . $file->storeAs('uploads/' . $company_id . '/' . $folder, $file_name);
return $path;
}
}