PHP code example of costamateus / laravel-mautic-api

1. Go to this page and download the library: Download costamateus/laravel-mautic-api 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/ */

    

costamateus / laravel-mautic-api example snippets


'providers' => [
	// ...
	Triibo\Mautic\MauticServiceProvider::class,
],

'aliases' => [
    // ...
    'Mautic' => Triibo\Mautic\Facades\Mautic::class,
],

use Triibo\Mautic\Facades\Mautic;

$params = array(
    'firstname' => 'Prince',
    'lastname'  => 'Ali Khan',
    'email'     => '[email protected]'
);

Mautic::request('POST','contacts/new',$params);

Mautic::request('GET','contacts');

Mautic::request('GET','contacts/1');
//where 1 is unique id for a contact.

Mautic::request('Delete','contacts/1/delete');