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 1mo ago

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

28

—

LowBetter than 54% of packages

Maintenance47

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b438a75edf013d1646299b1bb17fa137c79665123a4cee336f1944c5481a7efb?d=identicon)[iamnigelzw](/maintainers/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

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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