Skip to content

API Laravel adapted structure of Türkiye based Sendeo Cargo Company

License

Notifications You must be signed in to change notification settings

OrhanOzyalcin/SendeoClientLaravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sendeo Client Laravel

A Laravel-optimized PHP client library for Sendeo API integration.
This library simplifies communication with Sendeo API, providing methods for tracking, canceling deliveries, and more.


Installation

To install this package, run the following command in your Laravel project:

composer require orhanozyalcin/sendeo-client-laravel

Configuration

This package uses Laravel's Package Discovery, so no manual configuration is required. However, ensure the following is properly set up:

Publishing the Config File

After installing the package, publish the configuration file to your Laravel project:

php artisan vendor:publish --tag=sendeo_config

Service Provider

  1. The SendeoServiceProvider is automatically registered.

Facade

  1. The Sendeo alias is automatically added for easy usage.

### Example .env Configuration

# Live
SENDEO_API_ID=YourProductionApiID
SENDEO_API_PASSWORD=YourProductionApiPassword
SENDEO_API_URL=https://api.sendeo.com.tr

# Test
SENDEO_API_TEST_URL=https://api-dev.sendeo.com.tr
SENDEO_TEST_MODE=true

Usage

1. Using the Facade

You can interact with the Sendeo API using the Sendeo facade:

use Sendeo;
use SendeoClientLaravel\Models\TrackDelivery;

// Example: Track a delivery
$trackDelivery = new TrackDelivery('TRACK123456', 'REF123456');
$response = Sendeo::trackDelivery('auth-token', $trackDelivery);

dd($response);

2. Using the Service Container

Alternatively, you can resolve the SendeoClient service from the container:

use SendeoClientLaravel\Models\CancelDelivery;

$sendeoClient = app('sendeo-client');

// Example: Cancel a delivery
$cancelDelivery = new CancelDelivery('TRACK123456', 'REF123456');
$response = $sendeoClient->cancelDelivery('auth-token', $cancelDelivery);

dd($response);

3. Using the Debug Routes

// Usage: web.php or api.php file in Laravel
// use SendeoClientLaravel\Models\SendeoTestRoutes;
// SendeoTestRoutes::routes();

Features

Supported API Methods

1. Authentication

use SendeoClientLaravel\Models\LoginAES;

$loginUser = new LoginAES('TestUserName', 'TestPassWord');
$response = Sendeo::login($loginUser);

2. Track a Delivery

use SendeoClientLaravel\Models\TrackDelivery;

$trackDelivery = new TrackDelivery('TRACK123456', 'REF123456');
$response = Sendeo::trackDelivery('auth-token', $trackDelivery);

3. Cancel a Delivery

use SendeoClientLaravel\Models\CancelDelivery;

$cancelDelivery = new CancelDelivery('TRACK123456', 'REF123456');
$response = Sendeo::cancelDelivery('auth-token', $cancelDelivery);

4. Set a Delivery

Coming Soon!

Requirements

  • PHP: ^8.0
  • Laravel: ^9.0 | ^10.0
  • Sendeo API Access

Contribution

Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.


License

This package is licensed under the MIT License. See the LICENSE file for more details.


Author

Orhan Özyalçın
[email protected]

About

API Laravel adapted structure of Türkiye based Sendeo Cargo Company

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages