PHPackages                             sharpapi/laravel-tth-hospitality-product-categories - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sharpapi/laravel-tth-hospitality-product-categories

ActiveLibrary[API Development](/categories/api)

sharpapi/laravel-tth-hospitality-product-categories
===================================================

AI Hospitality Product Categorization for Laravel powered by SharpAPI.com

v1.0.3(1mo ago)00MITPHPPHP ^8.1

Since Jan 9Pushed 1mo agoCompare

[ Source](https://github.com/sharpapi/laravel-tth-hospitality-product-categories)[ Packagist](https://packagist.org/packages/sharpapi/laravel-tth-hospitality-product-categories)[ Docs](https://github.com/sharpapi/laravel-tth-hospitality-product-categories)[ RSS](/packages/sharpapi-laravel-tth-hospitality-product-categories/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

AI Hospitality Product Categorizer for Laravel
==============================================

[](#ai-hospitality-product-categorizer-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c3c9ab8374ede46e318a68394c7132259f3e03ef396e19dd611704368cfe7f31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73686172706170692f6c61726176656c2d7474682d686f73706974616c6974792d70726f647563742d63617465676f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sharpapi/laravel-tth-hospitality-product-categories)[![Total Downloads](https://camo.githubusercontent.com/ca5a721a79926b17412fcae16216df7ab7252a8c6274c3b4dc385d18bcf31a31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73686172706170692f6c61726176656c2d7474682d686f73706974616c6974792d70726f647563742d63617465676f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sharpapi/laravel-tth-hospitality-product-categories)

This package provides a Laravel integration for the SharpAPI Hospitality Product Categorization service. It allows you to automatically categorize hospitality products with relevance scores, which is perfect for organizing product catalogs, improving search functionality, and enhancing product discovery.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sharpapi/laravel-tth-hospitality-product-categories
```

Configuration
-------------

[](#configuration)

Publish the config file with:

```
php artisan vendor:publish --tag="sharpapi-tth-hospitality-product-categories"
```

This is the contents of the published config file:

```
return [
    'api_key' => env('SHARP_API_KEY'),
    'base_url' => env('SHARP_API_BASE_URL', 'https://sharpapi.com/api/v1'),
    'api_job_status_polling_wait' => env('SHARP_API_JOB_STATUS_POLLING_WAIT', 180),
    'api_job_status_polling_interval' => env('SHARP_API_JOB_STATUS_POLLING_INTERVAL', 10),
    'api_job_status_use_polling_interval' => env('SHARP_API_JOB_STATUS_USE_POLLING_INTERVAL', false),
];
```

Make sure to set your SharpAPI key in your .env file:

```
SHARP_API_KEY=your-api-key

```

Usage
-----

[](#usage)

```
use SharpAPI\TthHospitalityProductCategories\TthHospitalityProductCategoriesService;

$service = new TthHospitalityProductCategoriesService();

// Categorize a hospitality product
$categories = $service->hospitalityProductCategories(
    'Luxury Ocean View Suite with Balcony',
    'Miami Beach', // optional city
    'United States', // optional country
    'English', // optional language
    5, // optional max quantity of categories
    'professional', // optional voice tone
    'Spacious suite with king bed, private balcony, ocean views, and complimentary breakfast' // optional context
);

// $categories will contain a JSON string with the categorization results
```

Parameters
----------

[](#parameters)

- `productName` (string): The name of the product to categorize
- `city` (string|null): The city related to the product (optional)
- `country` (string|null): The country related to the product (optional)
- `language` (string|null): The language for the response (optional)
- `maxQuantity` (int|null): Maximum number of categories to return (optional)
- `voiceTone` (string|null): The tone of voice for the response (optional)
- `context` (string|null): Additional context for better categorization (optional)

Response Format
---------------

[](#response-format)

The response is a JSON string containing categories with weight scores:

```
{
  "data": {
    "type": "api_job_result",
    "id": "afb7cc23-23a5-479c-92a9-be983792dabc",
    "attributes": {
      "status": "success",
      "type": "tth_hospitality_product_categories",
      "result": [
        {
          "name": "Adult Only Hotels",
          "weight": 10
        },
        {
          "name": "Luxury Hotels",
          "weight": 8.5
        },
        {
          "name": "Boutique Hotels",
          "weight": 7.5
        },
        {
          "name": "Romantic Getaways",
          "weight": 7
        },
        {
          "name": "City Hotels",
          "weight": 6.5
        },
        {
          "name": "Couples Retreats",
          "weight": 6
        }
      ]
    }
  }
}
```

The weight score is a value between 1.0 and 10.0, where 10.0 represents 100% relevance.

Features
--------

[](#features)

- Automatically categorizes hospitality products
- Provides relevance scores for each category
- Supports location-specific categorization with city and country parameters
- Works with multiple languages
- Allows for additional context to improve categorization accuracy
- Helps organize product catalogs and improve search functionality

Credits
-------

[](#credits)

- [Dawid Makowski](https://github.com/dawidmakowski)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

4

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b500dd3d9b470b50b1ed911cd24a6fdcce51dd97dceb4f97879f727a14495a8?d=identicon)[dawid-makowski](/maintainers/dawid-makowski)

---

Top Contributors

[![makowskid](https://avatars.githubusercontent.com/u/6271194?v=4)](https://github.com/makowskid "makowskid (4 commits)")

---

Tags

phpapilaravelRESTful APItourismhotelsSharpAPIartificial intelligencenatural language processingsoftware developmentContent Analysisai apiAI-poweredapi integrationai capabilitiescategorizationtravelhospitalityProduct Managementaccommodations

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sharpapi-laravel-tth-hospitality-product-categories/health.svg)

```
[![Health](https://phpackages.com/badges/sharpapi-laravel-tth-hospitality-product-categories/health.svg)](https://phpackages.com/packages/sharpapi-laravel-tth-hospitality-product-categories)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
