diff --git a/app/Http/Controllers/ClientPortal/DocumentController.php b/app/Http/Controllers/ClientPortal/DocumentController.php index ec5a5fc0ae3f..3731cf842e39 100644 --- a/app/Http/Controllers/ClientPortal/DocumentController.php +++ b/app/Http/Controllers/ClientPortal/DocumentController.php @@ -49,7 +49,7 @@ class DocumentController extends Controller { $contact = auth()->user(); - Storage::makeDirectory('public/' . $contact->client->client_hash, 0755); + Storage::makeDirectory('public/' . $contact->client->client_hash, 0775); $path = Storage::putFile('public/' . $contact->client->client_hash, $request->file('file')); diff --git a/app/Jobs/Credit/CreateCreditPdf.php b/app/Jobs/Credit/CreateCreditPdf.php index d16aa6b63fd9..c1aa569b200b 100644 --- a/app/Jobs/Credit/CreateCreditPdf.php +++ b/app/Jobs/Credit/CreateCreditPdf.php @@ -87,7 +87,7 @@ class CreateCreditPdf implements ShouldQueue $html = (new HtmlEngine($designer, $this->invitation, 'credit'))->build(); - Storage::makeDirectory($path, 0755); + Storage::makeDirectory($path, 0775); $pdf = $this->makePdf(null, null, $html); diff --git a/app/Jobs/Invoice/CreateInvoicePdf.php b/app/Jobs/Invoice/CreateInvoicePdf.php index 67a68309bb91..b4924a0badce 100644 --- a/app/Jobs/Invoice/CreateInvoicePdf.php +++ b/app/Jobs/Invoice/CreateInvoicePdf.php @@ -86,7 +86,7 @@ class CreateInvoicePdf implements ShouldQueue $html = (new HtmlEngine($designer, $this->invitation, 'invoice'))->build(); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily - Storage::makeDirectory($path, 0755); + Storage::makeDirectory($path, 0775); $pdf = $this->makePdf(null, null, $html); diff --git a/app/Jobs/Quote/CreateQuotePdf.php b/app/Jobs/Quote/CreateQuotePdf.php index c3c9f9c298b7..e89016ad94a9 100644 --- a/app/Jobs/Quote/CreateQuotePdf.php +++ b/app/Jobs/Quote/CreateQuotePdf.php @@ -84,7 +84,7 @@ class CreateQuotePdf implements ShouldQueue $designer = new Designer($this->quote, $design, $this->quote->client->getSetting('pdf_variables'), 'quote'); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily - Storage::makeDirectory($path, 0755); + Storage::makeDirectory($path, 0775); $html = (new HtmlEngine($designer, $this->invitation, 'quote'))->build(); diff --git a/app/Jobs/Util/UploadAvatar.php b/app/Jobs/Util/UploadAvatar.php index 144c50240232..ff3d4bfc114a 100644 --- a/app/Jobs/Util/UploadAvatar.php +++ b/app/Jobs/Util/UploadAvatar.php @@ -39,7 +39,7 @@ class UploadAvatar implements ShouldQueue { //make dir - Storage::makeDirectory('public/' . $this->directory, 0755); + Storage::makeDirectory('public/' . $this->directory, 0775); $tmp_file = sha1(time()).".png"; diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 32846b01b84b..9969ac137fef 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -76,7 +76,7 @@ class Activity extends StaticModel const PAID_INVOICE=54; // const EMAIL_INVOICE_FAILED=57; const REVERSED_INVOICE=58; // - const CANCELLED_INVOICE=59; + const CANCELLED_INVOICE=59; // const VIEW_CREDIT=60; // protected $casts = [ diff --git a/app/Utils/PhantomJS/Phantom.php b/app/Utils/PhantomJS/Phantom.php index 3a5a6e32a69a..5371ee23b4a7 100644 --- a/app/Utils/PhantomJS/Phantom.php +++ b/app/Utils/PhantomJS/Phantom.php @@ -63,7 +63,7 @@ class Phantom $phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D"; $pdf = \App\Utils\CurlUtils::get($phantom_url); - Storage::makeDirectory($path, 0755); + Storage::makeDirectory($path, 0775); $instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf); diff --git a/config/filesystems.php b/config/filesystems.php index 1d44642d3e11..c132534fba80 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -46,6 +46,16 @@ return [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), + 'permissions' => [ + 'file' => [ + 'public' => 0664, + 'private' => 0600, + ], + 'dir' => [ + 'public' => 0777, + 'private' => 0700, + ], + ], ], 'public' => [ @@ -53,6 +63,16 @@ return [ 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', + 'permissions' => [ + 'file' => [ + 'public' => 0664, + 'private' => 0600, + ], + 'dir' => [ + 'public' => 0777, + 'private' => 0700, + ], + ], ], 's3' => [ diff --git a/tests/Integration/DesignTest.php b/tests/Integration/DesignTest.php index 1a4fdd71d65d..bc4604fad056 100644 --- a/tests/Integration/DesignTest.php +++ b/tests/Integration/DesignTest.php @@ -65,7 +65,8 @@ class DesignTest extends TestCase $this->invoice->uses_inclusive_taxes = false; - $this->invoice->service()->createInvitations()->markSent()->save(); + $this->invoice->service()->createInvitations()->markSent()->applyNumber()->save(); + $this->invoice->fresh(); $this->invoice->load('invitations');