PHPackages                             lamoud/laravel-nelc-xapi-integration - 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. lamoud/laravel-nelc-xapi-integration

ActiveProject[API Development](/categories/api)

lamoud/laravel-nelc-xapi-integration
====================================

xAPI Integration with NELC (National Center for e-Learning)

v1.0.9(2y ago)03MITPHPPHP ^7.4 || ^8.0

Since Dec 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lamoud/laravel-nelc-xapi-integration)[ Packagist](https://packagist.org/packages/lamoud/laravel-nelc-xapi-integration)[ Docs](https://github.com/lamoud/laravel-nelc-xapi-integration)[ RSS](/packages/lamoud-laravel-nelc-xapi-integration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (11)Used By (0)

Laravel Nelc Xapi Integration
=============================

[](#laravel-nelc-xapi-integration)

Laravel package for integrating with Saudi NELC xAPI.

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

[](#installation)

Step 1: Navigate to Your Project Directory
------------------------------------------

[](#step-1-navigate-to-your-project-directory)

Before you begin, navigate to the directory where your Laravel project is located. Use the following command to change into your project directory:

```
cd path/to/your/laravel-project
```

Step 2: Installation
--------------------

[](#step-2-installation)

You can install this library using Composer. Run the following command:

```
composer require lamoud/laravel-nelc-xapi-integration
```

Step 3: Register the ServiceProvider
------------------------------------

[](#step-3-register-the-serviceprovider)

Register the `NelcXapiServiceProvider` in your Laravel project. Open the `config/app.php` file and add the following line to the `providers` array:

```
// config/app.php

'providers' => ServiceProvider::defaultProviders()->merge([
    /*
        * Package Service Providers...
    */
    // Other providers...
    Lamoud\LaravelNelcXapiIntegration\NelcXapiServiceProvider::class,
])->toArray(),
```

Step 4: Dump Autoload Files
---------------------------

[](#step-4-dump-autoload-files)

After registering the ServiceProvider, run the following command to re-generate Composer's autoloader files:

```
composer dump-autoload
```

Step 5: Publish Configuration Files
-----------------------------------

[](#step-5-publish-configuration-files)

To publish the configuration files provided by this package, run the following Artisan command:

```
php artisan vendor:publish --provider="Lamoud\LaravelNelcXapiIntegration\NelcXapiServiceProvider"
```

This will deploy `asset` files inside the public folder with the name `lamoud-nelc-xapi` and the file `lamoud-nelc-xapi.php` inside the `config` folder.

Step 6: Configure Basic Settings
--------------------------------

[](#step-6-configure-basic-settings)

To start using this package, follow these steps to configure the basic settings and connect with NELC XAPI:

Open the `lamoud-nelc-xapi.php` file inside the `config` folder. Adjust the basic settings according to your requirements. Make sure to set up any necessary `enpoint`, `authentication (key, secret)` details, and other configuration options.

```
// config/lamoud-nelc-xapi.php
return [
    'endpoint'      => 'https://lrs.nelc.gov.sa/staging-lrs/xapi/statements', // Replace with endpoint.
    'middleware'      => ['web'], // Middleware to display the demo page, ['web', 'auth', ...]
    'key'    => 'userName',
    'secret'    => 'pasword',
    'platform_in_arabic'    => '', // Platform name in Arabic
    'platform_in_english'    => '', // Platform name in English
    'base_route'    => 'nelcxapi/test', // Demo Page Link
];
```

Now, you can go to the demo page and start testing statement submissions using the following link: `https://your-site.com/nelcxapi/test` or through the `route('lamoud-nelc-xapi.base_route')`.

Usage
-----

[](#usage)

Once the package is installed and the ServiceProvider is registered, you can use it in your Laravel project. Here's a simple examples:

Registered Statement
--------------------

[](#registered-statement)

Indicates the actor is officially enrolled or inducted in an activity.

```
use Lamoud\LaravelNelcXapiIntegration\XapiIntegration;
// ...

$xapi = new XapiIntegration();
$response = $xapi->Registered(
    '123456789', // Student National ID
    'betalamoud@gmail.com', // Student Email
    '123', // Course Id OR url Or slug
    'New Course', // Course Title
    'New Course description', // Course description
    'MR Hassan', // instructor Name
    'mrhassan@mail.com',  // instructor Email
);

// dd( $response['status'] ); return 200
// dd( $response['message'] ); return ok
// dd( $response['body'] ); return UUID
```

Initialized Statement
---------------------

[](#initialized-statement)

Indicates the activity provider has determined that the actor successfully started an activity.

```
use Lamoud\LaravelNelcXapiIntegration\XapiIntegration;
// ...

$xapi = new XapiIntegration();
$response = $xapi->Initialized(
    '123456789', // Student National ID
    'betalamoud@gmail.com', // Student Email
    '123', // Course Id OR url Or slug
    'New Course', // Course Title
    'New Course description', // Course description
    'MR Hassan', // instructor Name
    'mrhassan@mail.com',  // instructor Email
);

// dd( $response['status'] ); return 200
// dd( $response['message'] ); return ok
// dd( $response['body'] ); return UUID
```

Watched Statement
-----------------

[](#watched-statement)

Indicates that the actor has watched the object. This verb is typically applicable only when the object represents dynamic, visible content such as a movie, a television show or a public performance. This verb is a more specific form of the verbs experience, play and consume.

```
use Lamoud\LaravelNelcXapiIntegration\XapiIntegration;
// ...

$xapi = new XapiIntegration();
$response = $xapi->Watched(
    '123456789', // Student National ID
    'betalamoud@gmail.com', // Student Email
    '/url/to/lesson', // Lesson Or object URL
    'Lesson title', // Object title
    'Lesson description',  // Object description
    true, // The status indicating whether it has been fully watched (boolean).
    'PT15M', // The duration of the watching session in `ISO 8601` format.
    '123', // Course Id OR url Or slug
    'New Course', // Course Title
    'New Course description', // Course description
    'MR Hassan', // instructor Name
    'mrhassan@mail.com',  // instructor Email

);

// dd( $response['status'] ); return 200
// dd( $response['message'] ); return ok
// dd( $response['body'] ); return UUID
```

Completed Statement
-------------------

[](#completed-statement)

Indicates the actor finished or concluded the activity normally.

### Completed (Lesson or class)

[](#completed-lesson-or-class)

```
use Lamoud\LaravelNelcXapiIntegration\XapiIntegration;
// ...

$xapi = new XapiIntegration();
$response = $xapi->CompletedLesson(
    '123456789', // Student National ID
    'betalamoud@gmail.com', // Student Email
    '/url/to/lesson', // Lesson URL
    'Lesson title',
    'Lesson description',
    '123', // Course Id OR url Or slug
    'New Course', // Course Title
    'New Course description', // Course description
    'MR Hassan', // instructor Name
    'mrhassan@mail.com',  // instructor Email
);

// dd( $response['status'] ); return 200
// dd( $response['message'] ); return ok
// dd( $response['body'] ); return UUID
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

10

Last Release

862d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/33183bc1774ce52f715e55d8c0f2fb73744d598321989f9cb8082b2d91b140db?d=identicon)[lamoud](/maintainers/lamoud)

---

Top Contributors

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

---

Tags

xAPINELC xAPI IntegrationNELC Saudi

### Embed Badge

![Health badge](/badges/lamoud-laravel-nelc-xapi-integration/health.svg)

```
[![Health](https://phpackages.com/badges/lamoud-laravel-nelc-xapi-integration/health.svg)](https://phpackages.com/packages/lamoud-laravel-nelc-xapi-integration)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[php-xapi/client

client library for the Experience API (xAPI)

2344.4k](/packages/php-xapi-client)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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