fixes on auth customers
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user