PHPackages                             nigel/wit\_parser - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nigel/wit\_parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nigel/wit\_parser
=================

A custom Wit.ai parser for Laravel

1.0.3(1y ago)05MITPHPPHP ^8.0

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xulerxyz/wit_parser)[ Packagist](https://packagist.org/packages/nigel/wit_parser)[ RSS](/packages/nigel-wit-parser/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

Wit.ai Parser for Laravel
=========================

[](#witai-parser-for-laravel)

A Laravel package for interacting with Wit.ai's API, providing easy-to-use services for message parsing and entity/intent management.

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

[](#installation)

1. Install the package via Composer:

```
composer require nigel/wit_parser
```

2. Publish the configuration file:

```
php artisan vendor:publish --provider="Nigel\WitParser\WitParserServiceProvider" --tag="config"
```

3. Add your Wit.ai credentials to your `.env` file:

```
WIT_AI_TOKEN=your_wit_ai_token_here
WIT_AI_BASE_URL=https://api.wit.ai/

```

Usage
-----

[](#usage)

### Message Parsing

[](#message-parsing)

```
use Nigel\WitParser\WitParserService;

class YourController extends Controller
{
    public function parseMessage()
    {
        $parser = new WitParserService();
        $result = $parser->parse("What's the weather in New York?");

        // Access parsed data
        $intent = $result->intent;        // e.g., "get_weather"
        $confidence = $result->confidence; // e.g., 0.95
        $entities = $result->entities;    // Array of entities
        $raw = $result->raw;              // Raw API response
    }
}
```

### Managing Entities and Intents

[](#managing-entities-and-intents)

```
use Nigel\WitParser\WitManagerService;

class YourController extends Controller
{
    public function manageWit()
    {
        $manager = new WitManagerService();

        // Create a new entity
        $entity = $manager->createEntity('location', [
            ['value' => 'New York'],
            ['value' => 'London']
        ]);

        // Get all entities
        $entities = $manager->getEntities();

        // Create a new intent
        $intent = $manager->createIntent('get_weather', [
            ['text' => 'What\'s the weather in New York?'],
            ['text' => 'How\'s the weather in London?']
        ]);

        // Get all intents
        $intents = $manager->getIntents();

        // Get app info
        $appInfo = $manager->getAppInfo();
    }
}
```

Available Methods
-----------------

[](#available-methods)

### WitParserService

[](#witparserservice)

- `parse(string $message): WitResult` - Parse a message and get structured data

### WitManagerService

[](#witmanagerservice)

- `createEntity(string $name, array $values = []): array` - Create a new entity
- `getEntities(): array` - Get all entities
- `createIntent(string $name, array $examples = []): array` - Create a new intent
- `getIntents(): array` - Get all intents
- `getAppInfo(): array` - Get app information

WitResult Object
----------------

[](#witresult-object)

The `parse()` method returns a `WitResult` object with the following properties:

- `intent`: The detected intent
- `confidence`: Confidence score (0-1)
- `entities`: Array of detected entities
- `raw`: Raw API response

Error Handling
--------------

[](#error-handling)

The package throws `RuntimeException` with descriptive messages for:

- API request failures
- Invalid responses
- Network errors
- Authentication issues

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance44

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

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 ~0 days

Total

4

Last Release

446d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/169533196?v=4)[Ta Nya](/maintainers/iamnigelzw)[@iamnigelzw](https://github.com/iamnigelzw)

---

Top Contributors

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

---

Tags

laravelphpwitwitai

### Embed Badge

![Health badge](/badges/nigel-wit-parser/health.svg)

```
[![Health](https://phpackages.com/badges/nigel-wit-parser/health.svg)](https://phpackages.com/packages/nigel-wit-parser)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k124](/packages/oat-sa-tao-core)

PHPackages © 2026

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