Download the PHP package pralhadstha/nepalcan-laravel without Composer

On this page you can find all versions of the php package pralhadstha/nepalcan-laravel. 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 nepalcan-laravel

Nepal Can Move (NCM) Laravel Package

Latest Version on Packagist Tests License PHP Version

Laravel integration for the Nepal Can Move (NCM) courier and shipping API. Manage shipments, track deliveries, calculate rates, handle COD payments, and process webhooks — all with idiomatic Laravel patterns.

Built on top of Nepal Can PHP SDK.

Features

Requirements

Dependency Version
PHP ^8.1
Laravel 10.x, 11.x, or 12.x

Installation

The service provider and facade are auto-discovered. No manual registration needed.

Publish Configuration

This creates config/nepalcan.php in your application.

Configuration

Add these variables to your .env file:

Environment Variables

Variable Description Default
NEPALCAN_API_TOKEN Your NCM API token from the dashboard ""
NEPALCAN_ENVIRONMENT sandbox or production sandbox
NEPALCAN_BASE_URL Override the API base URL entirely null
NEPALCAN_WEBHOOK_VALIDATE_UA Validate webhook User-Agent header true
NEPALCAN_WEBHOOK_PATH Webhook endpoint path /nepalcan/webhook

Set NEPALCAN_ENVIRONMENT=production when you're ready to go live. This switches the base URL from demo.nepalcanmove.com to nepalcanmove.com.

Usage

Using the Facade

Create a Shipment

Track an Order

Calculate Shipping Rates

Available delivery types: TYPE_PICKUP_COLLECT (Door2Door), TYPE_SEND (Branch2Door), TYPE_D2B (Door2Branch), TYPE_B2B (Branch2Branch).

List Branches

Support Tickets

Staff Management

Using Dependency Injection

You can type-hint the SDK client directly in your controllers, jobs, or any service:

Webhook Handling

Automatic Route Registration

By default, the package registers a POST route at /nepalcan/webhook. Incoming webhook payloads are parsed and dispatched as Laravel events.

Make sure to exclude this path from CSRF verification. In Laravel 10:

In Laravel 11+:

To disable the automatic route, set NEPALCAN_WEBHOOK_PATH to an empty value or set webhook.path to null in the config.

User-Agent Validation

The package validates that incoming webhook requests have a User-Agent header starting with NCM-Webhook/. This prevents unauthorized requests from reaching your event listeners. Disable this with:

Listening for Events

Register listeners in your EventServiceProvider or use Event::listen():

Available Events

Every webhook dispatches the generic NepalCanWebhookReceived event. Additionally, a specific event is dispatched based on the webhook type:

Webhook Event Laravel Event Class
pickup_completed OmniCargo\NepalCan\Laravel\Events\PickupCompleted
sent_for_delivery OmniCargo\NepalCan\Laravel\Events\SentForDelivery
order_dispatched OmniCargo\NepalCan\Laravel\Events\OrderDispatched
order_arrived OmniCargo\NepalCan\Laravel\Events\OrderArrived
delivery_completed OmniCargo\NepalCan\Laravel\Events\DeliveryCompleted

All event classes carry a public readonly Webhook $webhook property with the parsed payload data.

Testing

Or run individual suites:

Credits

License

The MIT License (MIT). See LICENSE for details.


All versions of nepalcan-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
pralhadstha/nepal-can-php-sdk Version ^1.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^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 pralhadstha/nepalcan-laravel contains the following files

Loading the files please wait ...