From c8a79a40fe9590ddebf70dd63c02418385bd256d Mon Sep 17 00:00:00 2001 From: Asif Date: Mon, 2 Jul 2018 22:25:51 +0800 Subject: [PATCH] fetching branchname and popup --- .../Controllers/DeliveryInfoController.php | 7 +++- public/home.html | 40 ++++++++++++++----- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/DeliveryInfoController.php b/app/Http/Controllers/DeliveryInfoController.php index 66e32ad..23109fc 100644 --- a/app/Http/Controllers/DeliveryInfoController.php +++ b/app/Http/Controllers/DeliveryInfoController.php @@ -11,7 +11,8 @@ class DeliveryinfoController extends Controller { public function index() { - $deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->get(); + $com_id = Auth::user()->company()->first()->id; + $deliveryinfo = Deliveryinfo::where('com_id', $com_id)->get(); return response()->json($deliveryinfo, 200); } @@ -23,7 +24,9 @@ class DeliveryinfoController extends Controller */ public function show(Deliveryinfo $id) { - $deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail(); + // TODO : make user company not array + $com_id = Auth::user()->company()->get()[0]['id']; + $deliveryinfo = Deliveryinfo::where('com_id', $com_id)->where('id', $id)->firstOrFail(); return response()->json($deliveryinfo, 200); } diff --git a/public/home.html b/public/home.html index 56536b9..9fbb76e 100644 --- a/public/home.html +++ b/public/home.html @@ -643,7 +643,7 @@
- +
Delivery Information
@@ -1305,6 +1305,8 @@