Skip to content

dashxhq/dashx-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


DashX

Your All-in-One Product Stack


dashx-php

DashX SDK for PHP (Experimental)

Installation

Usage

# include composer autoload
require 'vendor/autoload.php';

# import the DashX Client Class
use Dashx\Php\Client;

# create DashX instance
$dashx = new Client(
    'DASHX_PUBLIC_KEY',
    'DASHX_PRIVATE_KEY',
    'DASHX_TARGET_ENVIRONMENT',
    'DASHX_URI'
);

$dashx->deliver('email/forgot-password', [
    'to' => 'youremail@example.com',
    'data' => [
        'token' => 'tokenvalue'
        // ... rest of data payload
    ]
]);

Integration with Laravel

To integrate DashX with Laravel, run the following artisan command to publish the configuration file:

php artisan vendor:publish --provider="Dashx\Php\Laravel\DashxServiceProvider"

Add DashX environment variables with values:

DASHX_URI=
DASHX_PUBLIC_KEY=
DASHX_PRIVATE_KEY=
DASHX_TARGET_ENVIROMENT=

Usage with Laravel

use DashX;

DashX::deliver('email/forgot-password', [
    'to' => 'youremail@example.com',
    'data' => [
        'token' => 'tokenvalue'
        // ... rest of data payload
    ]
]);