Download the PHP package mahmoud-hamed/laravel-nafith without Composer

On this page you can find all versions of the php package mahmoud-hamed/laravel-nafith. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-nafith

Laravel Nafith

GitHub | Packagist | Issues

Laravel Nafith is a Laravel package for integrating with the Nafith Electronic Promissory Note (Sanad) platform.

This Nafith Laravel package handles OAuth2 authentication, sanad creation, sanad closing, status sync, and HMAC-SHA256 webhook verification. It also provides a database-backed tracking model that works with any Eloquent model, including models that use string or UUID primary keys.

Features

Why This Package

Requirements

Installation

1. Require the package

Laravel's auto-discovery registers the service provider automatically.

2. Publish config and migration

This creates:

3. Run the migration

4. Add environment variables

Add these to your .env:

5. Add log channels (recommended)

Add these to your config/logging.php under the 'channels' array:

Sensitive payload data is redacted from logs by default. Only enable NAFITH_LOG_SENSITIVE_DATA=true for short-lived local debugging.

Quick Start

Creating a Sanad

Closing a Sanad

Syncing Status from Nafith API

Running the Artisan Command

Scheduling the Sync Command

Add to routes/console.php:

Webhook Setup

The package automatically registers a webhook endpoint at:

Configure the URI and middleware in config/nafith.php:

Webhook Flow

  1. Nafith sends a POST to your webhook URL
  2. The package verifies the HMAC-SHA256 signature
  3. Parses the payload and normalizes the status
  4. Dispatches NafithWebhookReceived event
  5. The default listener updates the NafithSanad record in the database

Listening for Webhooks

The default listener handles database updates automatically. To add custom behavior (e.g., send notifications), listen to the event:

Using the NafithSanad Model

The NafithSanad model uses a polymorphic nafithable relation, so it works with any Eloquent model.

Sensitive debtor fields and stored payload snapshots are encrypted at rest and hidden from JSON serialization by default.

Adding the Relationship to Your Model

Querying Sanads

Getting the Parent Model

Using the Low-Level API Client

If you need direct API access without the service layer:

NafithStatus Enum

Architecture

License

MIT


All versions of laravel-nafith with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
php Version ^8.2
illuminate/cache Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/config Version ^11.0|^12.0
illuminate/log Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0
illuminate/events Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mahmoud-hamed/laravel-nafith contains the following files

Loading the files please wait ...