public function getClientStock(Request $request) { $login = Login::where('remember_token', '=', $request->header('token'))->where('login_from', '=', $request->ip())->join('members', 'members.id', '=', 'logins.member_id')->where('logins.status', '=', '1')->first(); if ($login->mtype == 1) { $clientStocks = ClientStock::all(); $returnData = array('status' => 'ok', 'code' => '200', 'clientStock' => $clientStocks); return Response::json($returnData, 200); } return $login->mtype; }