定制 trophy/php 二次开发

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

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

trophy/php

Composer 安装命令:

composer require trophy/php

包简介

Trophy PHP Library

README 文档

README

The Trophy PHP SDK provides convenient access to the Trophy API from applications written in PHP.

Trophy provides APIs and tools for adding gamification to your application, keeping users engaged through rewards, achievements, streaks, and personalized communication.

Installation

You can install the bindings via Composer. Run the following command:

composer require trophyso/php

To use the bindings, use the Composer's autoload:

require_once('vendor/autoload.php');

Usage

The package needs to be configured with your account's API key, which is available in the Trophy web interface. Set the API key with the following:

use Trophy\TrophyClient;
use Trophy\Metrics\Requests\MetricsEventRequest;
use Trophy\Types\EventRequestUser;

$trophy = new TrophyClient('your-api-key');

Then you can access the Trophy API through the $trophy client. For example, you can send a metric event:

// Create a new user object
$user = new EventRequestUser([
    'id' => '18',
    'email' => 'jk.rowling@harrypotter.com'
]);

// Create a new MetricsEventRequest object
$request = new MetricsEventRequest([
    'user' => $user,
    'value' => 750
]);

// Send the event to the Trophy API
$trophy->metrics->event("words-written", $request);

Documentation

See the Trophy API Docs for more information on the accessible endpoints.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固