use App\Models\Product; $products = Product::with("category")->take(1)->get(); echo json_encode($products);