Skip to content

Commit

Permalink
fixed storage path
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Aug 24, 2023
1 parent 4d7aca4 commit aa1251a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/Abstracts/Http/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\Document\Document;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Storage;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

Expand Down Expand Up @@ -161,7 +162,7 @@ public function getModuleUrl($invoice, $suffix)
public function getLogger()
{
$log = new Logger($this->alias);
$log->pushHandler(new StreamHandler(storage_path('logs/' . $this->alias . '.log')), Logger::INFO);
$log->pushHandler(new StreamHandler(Storage::path('logs/' . $this->alias . '.log')), Logger::INFO);

return $log;
}
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Commands/StorageTempClear.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;

class StorageTempClear extends Command
{
Expand Down Expand Up @@ -31,7 +32,7 @@ public function handle()
{
$filesystem = app(Filesystem::class);

$path = storage_path('app/temp');
$path = Storage::path('app/temp');

foreach ($filesystem->glob("{$path}/*") as $file) {
$filesystem->delete($file);
Expand Down
3 changes: 2 additions & 1 deletion app/Jobs/Install/CopyFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Abstracts\Job;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Storage;

class CopyFiles extends Job
{
Expand Down Expand Up @@ -35,7 +36,7 @@ public function handle()
throw new \Exception(trans('modules.errors.file_copy', ['module' => $this->alias]));
}

$source = storage_path('app/temp/' . $this->path);
$source = Storage::path('app/temp/' . $this->path);

$destination = $this->getDestination($source);

Expand Down
3 changes: 2 additions & 1 deletion app/Jobs/Install/DownloadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Traits\SiteApi;
use App\Utilities\Info;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;

class DownloadFile extends Job
{
Expand Down Expand Up @@ -47,7 +48,7 @@ public function handle()
}

$path = 'temp-' . md5(mt_rand());
$temp_path = storage_path('app/temp/' . $path);
$temp_path = Storage::path('app/temp/' . $path);

$file_path = $temp_path . '/upload.zip';

Expand Down
3 changes: 2 additions & 1 deletion app/Jobs/Install/UnzipFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Abstracts\Job;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use ZipArchive;

class UnzipFile extends Job
Expand Down Expand Up @@ -35,7 +36,7 @@ public function handle()
throw new \Exception(trans('modules.errors.unzip', ['module' => $this->alias]));
}

$temp_path = storage_path('app/temp/' . $this->path);
$temp_path = Storage::path('app/temp/' . $this->path);

$file = $temp_path . '/upload.zip';

Expand Down
3 changes: 2 additions & 1 deletion app/Traits/Documents.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Egulias\EmailValidator\Validation\RFCValidation;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Storage;

trait Documents
{
Expand Down Expand Up @@ -187,7 +188,7 @@ public function storeDocumentPdfAndGetPath($document)

$file_name = $this->getDocumentFileName($document);

$pdf_path = storage_path('app/temp/' . $file_name);
$pdf_path = Storage::path('app/temp/' . $file_name);

// Save the PDF file into temp folder
$pdf->save($pdf_path);
Expand Down
3 changes: 2 additions & 1 deletion app/Traits/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\Banking\Transaction;
use App\Interfaces\Utility\TransactionNumber;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Storage;

trait Transactions
{
Expand Down Expand Up @@ -161,7 +162,7 @@ public function storeTransactionPdfAndGetPath(Transaction $transaction): string

$file_name = $this->getTransactionFileName($transaction);

$pdf_path = storage_path('app/temp/' . $file_name);
$pdf_path = Storage::path('app/temp/' . $file_name);

// Save the PDF file into temp folder
$pdf->save($pdf_path);
Expand Down

0 comments on commit aa1251a

Please sign in to comment.