minchao/mitake-laravel 问题修复 & 功能扩展

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

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

minchao/mitake-laravel

Composer 安装命令:

composer require minchao/mitake-laravel

包简介

Laravel Package for Mitake's PHP SDK

README 文档

README

Build Status Latest Stable Version Latest Unstable Version composer.lock

This is a simple Laravel service provider for making it easy to access the Mitake PHP SDK in your Laravel and Lumen applications.

Installation

The Mitake service provider can be installed via Composer.

composer require minchao/mitake-laravel

To use the Mitake service provider, you must register the provider when bootstrapping your application.

Laravel

Laravel 5.5 and above

The package will automatically register provider and facade.

Laravel 5.4 and below

Add Mitake\Laravel\MitakeServiceProvider to the providers section of your config/app.php:

    'providers' => [
        // ...
        Mitake\Laravel\MitakeServiceProvider::class,
    ];

Add Mitake facade to the aliases section of your config/app.php:

    'aliases' => [
        // ...
        'Mitake' => Mitake\Laravel\Facade\Mitake::class,
    ];

Or use the facade class directly:

use Mitake\Laravel\Facade\Mitake;

Lumen

Register the Mitake\Laravel\MitakeServiceProvider in your bootstrap/app.php:

    $app->register(Mitake\Laravel\MitakeServiceProvider::class);

Copy the mitake.php config file in to your project:

mkdir config
cp vendor/minchao/mitake-laravel/config/mitake.php config/mitake.php

Configuration

Publish the package configuration using Artisan (Lumen doesn't support).

php artisan vendor:publish --provider="Mitake\Laravel\MitakeServiceProvider"

Then update config/mitake.php with your credentials. Alternatively, you can update your .env file.

MITAKE_USERNAME=username
MITAKE_PASSWORD=password

Usage

To use the Mitake SDK within your app, you need to retrieve it from the service container:

$mitake = app(\Mitake\Client::class);

$message = (new \Mitake\Message\Message())
    ->setDstaddr('0987654321')
    ->setSmbody('Hello, Laravel IoC Container');
$result = $mitake->send($message);

Or, you can use the Mitake facade:

$message = (new \Mitake\Message\Message())
    ->setDstaddr('0987654321')
    ->setSmbody('Hello, Facade');
$result = Mitake::send($message);

License

See the LICENSE file for license rights and limitations (BSD 3-Clause).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固