From 5db7438c276c1b01915fc2b2c6faa6f205eb25d2 Mon Sep 17 00:00:00 2001 From: ludo Date: Mon, 11 Mar 2024 18:48:25 +0100 Subject: [PATCH] fixes on auth customers --- app/Datatables/Shop/CustomerInvoicesDataTable.php | 3 ++- app/Datatables/Shop/CustomerOrdersDataTable.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Datatables/Shop/CustomerInvoicesDataTable.php b/app/Datatables/Shop/CustomerInvoicesDataTable.php index f6d0bec2..1f2f28e5 100644 --- a/app/Datatables/Shop/CustomerInvoicesDataTable.php +++ b/app/Datatables/Shop/CustomerInvoicesDataTable.php @@ -4,6 +4,7 @@ namespace App\Datatables\Shop; use App\Datatables\ParentDataTable as DataTable; use App\Models\Shop\Invoice; +use App\Repositories\Shop\Customers; use App\Repositories\Shop\InvoicePayments; use App\Repositories\Shop\Invoices; use Illuminate\Support\Facades\Auth; @@ -28,7 +29,7 @@ class CustomerInvoicesDataTable extends DataTable public function query(Invoice $model) { - $customerId = Auth::id(); + $customerId = Customers::getId(); $model = $model->byCustomer($customerId)->with(['address']); return $this->buildQuery($model); diff --git a/app/Datatables/Shop/CustomerOrdersDataTable.php b/app/Datatables/Shop/CustomerOrdersDataTable.php index a0fe7f7c..ed2d6aec 100644 --- a/app/Datatables/Shop/CustomerOrdersDataTable.php +++ b/app/Datatables/Shop/CustomerOrdersDataTable.php @@ -4,6 +4,7 @@ namespace App\Datatables\Shop; use App\Datatables\ParentDataTable as DataTable; use App\Models\Shop\Order; +use App\Repositories\Shop\Customers; use App\Repositories\Shop\Orders; use Illuminate\Support\Facades\Auth; use Yajra\DataTables\Html\Column; @@ -27,7 +28,7 @@ class CustomerOrdersDataTable extends DataTable public function query(Order $model) { - $customerId = Auth::id(); + $customerId = Customers::getId(); $model = $model->byCustomer($customerId); return $this->buildQuery($model);