PHP code example of rubengomez / cxf

1. Go to this page and download the library: Download rubengomez/cxf 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/ */

    

rubengomez / cxf example snippets


use Cxf\UserAuthTrait;
use Cxf\ContactAuthTrait;
use Cxf\PublicAuthTrait;

// User Login
$this->initializeUserClient();
$this->mintsUserLogin('email', 'password');
$response = $this->mintsUser->getContacts(); // get contacts

// Contact Login
$this->initializeContactClient();
$this->mintsContactLogin('email', 'password');
$response = $this->mintsContact->getOrders(); // get orders

// Public trait usage
$this->initializePublicClient();
$response = $this->mintsPublic->getStoryVersions(null, false); // get story versions
 // Proxy Routes
Route::any('api/user/v1/{any}', [ProxyController::class, 'proxyRequest'])->where('any', '.*');
Route::any('api/contact/v1/{any}', [ProxyController::class, 'proxyRequest'])->where('any', '.*');
Route::any('api/v1/{any}', [ProxyController::class, 'proxyRequest'])->where('any', '.*');