whereRaw("BINARY `token`= ?", [$request->header('X-API-TOKEN')])->first(); $products = Product::where('company_id', $company_token->company->id); return $this->listResponse($products); } public function show(string $product_key) { $company_token = CompanyToken::with(['company'])->whereRaw("BINARY `token`= ?", [$request->header('X-API-TOKEN')])->first(); $product = Product::where('company_id', $company_token->company->id) ->where('product_key', $product_key) ->first(); return $this->itemResponse($product); } }