keapgeek/laravel-keap 问题修复 & 功能扩展

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

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

keapgeek/laravel-keap

Composer 安装命令:

composer require keapgeek/laravel-keap

包简介

Laravel Package for accessing the Keap REST API (v1/v2)

README 文档

README

Let's be honest, the php-infusionsoft SDK is shit. Barely any support for modern version of PHP and all the laravel packages, such as the upwebdesign one, that has been the main inspiration for this package, rely on the old architecture and legacy version of the Infusionsoft API.

I jump in to ensure a Laravel 10+ support for this package that completely ignores the PHP SDK and builds it's own wrapper using Laravel helpers and architectures.

This package uses OAuth 2 with the REST API v1 or v2 of Keap, WITHOUT relying on the SDK of infusionsoft.

You can find a whole website with the documentation for this package at in the wiki.

Installation

To install this package, we need to install the Laravel part and create the API credentials to connect to your Keap Application.

Laravel set up

To install the package you can use the following command

composer require keapgeek/laravel-keap

then install the package to publish the configuration

php artisan keap:install

In the environment file add the following lines

KEAP_CLIENT_KEY="Client from the developer account"
KEAP_CLIENT_SECRET="Secret from the developer account"

Keap set up

Before we start installing the package, we need to create a Keap developer account and get our API credentials.

For more information look at the Keap documentation: visit the complete Installation Guide

In shorts the steps are repeated here below:

  • Create a Developer Account
  • Generate the Api Keys
  • Authenticate

First Use

After installation and having setup the environment variables in the .env file. You can access the /keap/auth uri in your browser, even in the local version, to access the login page of Keap. Once logged in you can authorize the access to a specific app.

I strongly suggest to use a sandbox version of Keap, and test your Api before connecting it to your real app with your clients data.

Automatically Keap will redirect you to a confirmation page that will simply say Successful Connection!. From there you can start using the Laravel Keap service.

Automatically refresh the Oath token

Keap will transmit an access and refresh token that are stored in the cache, therefore pay attention when you clear it.

The refresh code can be used only for 24 hours. However, you can refresh the code with the artisan command

php artisan keap:refresh

You can set up this command in the Console\Kernel.php file to run twice or thrice a day to prevent the code from expiring.

    protected function schedule(Schedule $schedule): void
    {
        // Other scheduled commands
        $schedule->command('keap:refresh')->twiceDaily(1, 13);
    }

Accessing the API

To access the REST API, you can use the Keap Facade:

use KeapGeek\Keap\Facades\Keap;

// To list all the contacts the contacts
Keap::contact()->list;

// To create a new tag
Keap::tag()->create(...);

The methods of the Keap Facade allow you to automatically call the API endpoints.

A list of all the available methods are can be found in the API Docs

Testing

composer test

Credits

Any help in developing this package is welcome!

License

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

keapgeek/laravel-keap 适用场景与选型建议

keapgeek/laravel-keap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.2k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2024 年 05 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「REST API」 「infusionsoft」 「keap」 「keapgeek」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 keapgeek/laravel-keap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 keapgeek/laravel-keap 我们能提供哪些服务?
定制开发 / 二次开发

基于 keapgeek/laravel-keap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-23