commeted out delivery info test TBD

added delivery info index to show lists of delivery info for the company
fixed delivery info show security
This commit is contained in:
Jack Goh
2018-06-20 11:00:15 +08:00
parent 5fecbf8ade
commit f21c6c9ded
3 changed files with 47 additions and 18 deletions
@@ -8,6 +8,11 @@ use Auth;
class DeliveryinfoController extends Controller
{
public function index()
{
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->get();
return response()->json($deliveryinfo, 200);
}
/**
* Display the specified delivery-info.
@@ -17,8 +22,7 @@ class DeliveryinfoController extends Controller
*/
public function show(Deliveryinfo $id)
{
$deliveryinfo = deliveryinfo::find($id);
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail();
return response()->json($deliveryinfo, 200);
}