PHP code example of enspireagencia / laravel-rd-station

1. Go to this page and download the library: Download enspireagencia/laravel-rd-station library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

enspireagencia / laravel-rd-station example snippets


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'),
];

// 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

use Pedroni\RdStation\Facades\RdStation;

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

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([...]);
    }
}

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