fixes on auth customers

This commit is contained in:
ludo
2024-03-11 18:48:25 +01:00
parent 2227242704
commit 5db7438c27
2 changed files with 4 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Datatables\Shop;
use App\Datatables\ParentDataTable as DataTable; use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\Invoice; use App\Models\Shop\Invoice;
use App\Repositories\Shop\Customers;
use App\Repositories\Shop\InvoicePayments; use App\Repositories\Shop\InvoicePayments;
use App\Repositories\Shop\Invoices; use App\Repositories\Shop\Invoices;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@@ -28,7 +29,7 @@ class CustomerInvoicesDataTable extends DataTable
public function query(Invoice $model) public function query(Invoice $model)
{ {
$customerId = Auth::id(); $customerId = Customers::getId();
$model = $model->byCustomer($customerId)->with(['address']); $model = $model->byCustomer($customerId)->with(['address']);
return $this->buildQuery($model); return $this->buildQuery($model);

View File

@@ -4,6 +4,7 @@ namespace App\Datatables\Shop;
use App\Datatables\ParentDataTable as DataTable; use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\Order; use App\Models\Shop\Order;
use App\Repositories\Shop\Customers;
use App\Repositories\Shop\Orders; use App\Repositories\Shop\Orders;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Yajra\DataTables\Html\Column; use Yajra\DataTables\Html\Column;
@@ -27,7 +28,7 @@ class CustomerOrdersDataTable extends DataTable
public function query(Order $model) public function query(Order $model)
{ {
$customerId = Auth::id(); $customerId = Customers::getId();
$model = $model->byCustomer($customerId); $model = $model->byCustomer($customerId);
return $this->buildQuery($model); return $this->buildQuery($model);