|
|
|
@ -13,6 +13,8 @@ use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Http; |
|
|
|
|
use Laravel\Lumen\Routing\Controller as BaseController; |
|
|
|
|
use RecursiveIteratorIterator; |
|
|
|
|
use RecursiveDirectoryIterator; |
|
|
|
|
|
|
|
|
|
class Controller extends BaseController |
|
|
|
|
{ |
|
|
|
@ -54,7 +56,19 @@ class Controller extends BaseController
|
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function setLimitsStorage($company, $dokumen, $name, $initPath, $destinatePath) { |
|
|
|
|
public function storage($company_name) |
|
|
|
|
{ |
|
|
|
|
$directory = 'assets/' . urldecode($company_name); |
|
|
|
|
|
|
|
|
|
$size = 0; |
|
|
|
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file) { |
|
|
|
|
$size += $file->getSize(); |
|
|
|
|
} |
|
|
|
|
return round($size / 1048576, 2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function setLimitsStorage($company, $dokumen, $name, $initPath, $destinatePath) |
|
|
|
|
{ |
|
|
|
|
$totalSize = 0; |
|
|
|
|
$sizeFile = $dokumen->getSize(); |
|
|
|
|
// Path |
|
|
|
|