定制 biohazard/amocrm-api-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

biohazard/amocrm-api-laravel

最新稳定版本:0.0.8

Composer 安装命令:

composer require biohazard/amocrm-api-laravel

包简介

AmoCRM api for Laravel 10

README 文档

README

AmoCRM api for laravel 10

Installation

$ composer require biohazard/amocrm-api-laravel
$ php artisan vendor:publish --tag=amocrm-api - Create file config/amocrm-api.php

.env

AMOCRM_ID="e717af4f-171c-475a-a4c7-d2f6f726c3a6"
AMOCRM_SECRET="chlQrrh7YUfgaQ0JuKoJBcBsgt1UdiiQZEAEH0U0dUF8pRPSJ1CXOr7dLLU8fvcr"
AMOCRM_REDIRECT_URI="http://f0783886.xsph.ru/index.php"
AMOCRM_SUBDOMAIN="stalkernikko.amocrm.ru"
AMOCRM_MIDDLEWARE_REDIRECT="amocrm-api.get-token"

Example Controller

...
use Biohazard\AmoCRMApi\AmoCRMApiClient;
use League\OAuth2\Client\Token\AccessToken;
use AmoCRM\Models\AccountModel;
use AmoCRM\Exceptions\AmoCRMApiException;
...
class Account extends Controller
{
    
    public function index(AmoCRMApiClient $amocrm, AccessToken $accessToken) {
        try {
            $account = $amocrm->account()->getCurrent(AccountModel::getAvailableWith());
            dump($account);
        } catch (AmoCRMApiException $e) {
            echo $e->getMessage();
        }
   }
}

Middleware add file app/Http/Kernel.php

protected $middlewareAliases = [
    ...
    'amocrm-api' => \Biohazard\AmoCRMApi\Middleware\AmoCRMApi::class,
]

Route

Route::get('/account/', 'App\Http\Controllers\Account@index')
    ->middleware('amocrm-api')
    ->name('account');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-04