定制 pedroni/laravel-rd-station 二次开发

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

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

pedroni/laravel-rd-station

最新稳定版本:v7.0.1

Composer 安装命令:

composer require pedroni/laravel-rd-station

包简介

Integrate your Laravel project with RD Station

README 文档

README

Latest Version on Packagist GitHub Actions Workflow Status GitHub Actions Workflow Status Total Downloads

This is a Laravel wrapper around the RD Station API.

Laravel Support Matrix

This table outlines the Laravel versions supported by each version of our library.

Library Version Laravel Version
1.x, 2.x, 3.x 8.x
4.x 9.x
5.x 10.x
6.x 11.x
7.x 12.x

Installation

You can install the package via composer:

composer require pedroni/laravel-rd-station

You can publish the config file with:

php artisan vendor:publish --tag="rd-station-config"

This is the contents of the published config file:

return [
    'base_url' => env('RD_STATION_BASE_URL', 'https://api.rd.services'),
    'client_id' => env('RD_STATION_CLIENT_ID'), // REQUIRED
    'client_secret' => env('RD_STATION_CLIENT_SECRET'), // REQUIRED
    'redirect_path' => env('RD_STATION_REDIRECT_PATH', 'rd-station/oauth/callback'),
];

⚠️ The env variable RD_STATION_REDIRECT_PATH MUST match your route endpoint that will be configured later

Publish migrations files and run the migrations:

php artisan vendor:publish --tag="rd-station-migrations"
php artisan migrate

Add two GET routes for the installation controller and the callback controller, example:

// routes/web.php

use Pedroni\RdStation\Controllers\OAuthInstall;
use Pedroni\RdStation\Controllers\OAuthCallback;

Route::get('rd-station/oauth/install', OAuthInstall::class);
Route::get('rd-station/oauth/callback', OAuthCallback::class); // recommended

Open a browser window on http://your-domain.com/rd-station/oauth/install to initiate the instalation.

⚠️ If you decide to change the recommended callback URL you MUST change the RD_STATION_REDIRECT_PATH variable

Usage

Using the facade

use Pedroni\RdStation\Facades\RdStation;

RdStation::events()->conversion([
    'email' => 'example@mail.com',
    'conversion_identifier' => 'identifier',
    'cf_example' => 'An example of custom field',
    'tags' => ['example-tag'],
]);

Using dependency injection

use Pedroni\RdStation;

public function ExampleController
{
    public function exampleUsingAnArgument(RdStation $rdStation)
    {
        $rdStation->events()->conversion([...]);
    }

    public function exampleUsingLaravelContainer()
    {
        $rdStation = app()->make(RdStation::class);

        $rdStation->events()->conversion([...]);
    }
}

Testing

composer test
docker run --rm -v $(pwd):/app -w /app composer:latest bash -c "composer install && vendor/bin/pest"

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固