From c680ccf8f76c97bd430f519ffb282ab13cf40c0c Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Mon, 15 Oct 2018 16:10:49 +0300 Subject: [PATCH] Invoice page added customer share link --- app/Http/Controllers/Incomes/Invoices.php | 5 ++++- app/Utilities/Modules.php | 6 +++++- public/css/app.css | 4 ++++ resources/views/incomes/invoices/show.blade.php | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Incomes/Invoices.php b/app/Http/Controllers/Incomes/Invoices.php index dd97566a2..123a2c621 100644 --- a/app/Http/Controllers/Incomes/Invoices.php +++ b/app/Http/Controllers/Incomes/Invoices.php @@ -36,6 +36,7 @@ use File; use Illuminate\Http\Request as ItemRequest; use Image; use Storage; +use SignedUrl; class Invoices extends Controller { @@ -117,7 +118,9 @@ class Invoices extends Controller $payment_methods = Modules::getPaymentMethods(); - return view('incomes.invoices.show', compact('invoice', 'accounts', 'currencies', 'account_currency_code', 'customers', 'categories', 'payment_methods')); + $customer_share = SignedUrl::sign(url('links/invoices/' . $invoice->id)); + + return view('incomes.invoices.show', compact('invoice', 'accounts', 'currencies', 'account_currency_code', 'customers', 'categories', 'payment_methods', 'customer_share')); } /** diff --git a/app/Utilities/Modules.php b/app/Utilities/Modules.php index f5495c2f4..eba746c9c 100644 --- a/app/Utilities/Modules.php +++ b/app/Utilities/Modules.php @@ -20,7 +20,11 @@ class Modules $payment_methods = Cache::get($cache_admin); - $customer = auth()->user()->customer; + $customer = true; + + if (auth()->user()) { + $customer = auth()->user()->customer; + } if ($customer && $type != 'all') { $payment_methods = Cache::get($cache_customer); diff --git a/public/css/app.css b/public/css/app.css index 312a63455..2aaad375c 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -736,3 +736,7 @@ input[type="number"] { border-radius: 0px; vertical-align: top; } + +.link .content-wrapper, .link .right-side, .link .main-footer { + margin-left: inherit; +} \ No newline at end of file diff --git a/resources/views/incomes/invoices/show.blade.php b/resources/views/incomes/invoices/show.blade.php index 6e27c209c..031d1c557 100644 --- a/resources/views/incomes/invoices/show.blade.php +++ b/resources/views/incomes/invoices/show.blade.php @@ -168,6 +168,9 @@   {{ trans('general.print') }} + +   Share +