mchervenkov/sameday 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mchervenkov/sameday

最新稳定版本:v1.0.3

Composer 安装命令:

composer require mchervenkov/sameday

包简介

Laravel Sameday API Wrapper

README 文档

README

Latest Version on Packagist Total Downloads

Sameday JSON API Documentation

Installation

You can install the package via composer:

composer require mchervenkov/sameday

If you plan to use database for storing nomenclatures:

php artisan migrate

If you need to export configuration file:

php artisan vendor:publish --tag=sameday-config

If you need to export migrations:

php artisan vendor:publish --tag=sameday-migrations

If you need to export models:

php artisan vendor:publish --tag=sameday-models

If you need to export commands:

php artisan vendor:publish --tag=sameday-commands

Configuration

SAMEDAY_ENV=test|production #default=test
SAMEDAY_AUTH_USERNAME= #default=test-sameday-username
SAMEDAY_AUTH_PASSWORD= #default=test-sameday-password
SAMEDAY_API_TEST_BASE_URI= #default=https://sameday-api-bg.demo.zitec.com
SAMEDAY_API_PRODUCTION_BASE_URI= #default=https://sameday-api.demo.zitec.com
SAMEDAY_API_TIMEOUT= #default=5

Usage

Methods

// Init Sameday Client
$sameday = new Sameday();

// Client endpoints
$sameday->getServices();
$sameday->getPickupPoints();
$sameday->getAwbStatus();
$sameday->syncStatus();

// Geolocation endpoints
$sameday->getCounties();
$sameday->getCities();

// Lockers endpoints
$sameday->getLockers();

Commands

#get counties with database (use -h to view options)
php artisan sameday:get-counties

#get cities with database (use -h to view options)
php artisan sameday:get-cities

#create cities map with other carriers in database  (use -h to view options)
php artisan sameday:map-cities

#get lockers with database (use -h to view options)
php artisan sameday:get-lockers 

#get sameday api status (use -h to view options)
php artisan sameday:api-status

Models

SamedayCity
SamedayCounty
SamedayApiStatus
SamedayLocker
CarrierCityMap

Examples

Without Params

$sameday = new Sameday();
$response = $sameday->getCities();
dd($response);

With Hydrator

$sameday = new Sameday();
$cityHydrator = new City(['countyCode' => 'BG']);
$response = $sameday->getCities($cityHydrator);
dd($response);

With Hydrator and Paginator

$sameday = new Sameday();
$cityHydrator = new City(['countyCode' => 'BG']);
$paginator = new Paginator(1, 50);
$response = $sameday->getCities($cityHydrator, $paginator);
dd($response);

Testing

Before running tests set your api credentials in sameday.php config file

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email mario.chervenkov@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.54k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-13