PHP code example of coolcodemy / yourmembership-laravel-api

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

    

coolcodemy / yourmembership-laravel-api example snippets


CoolCodeMY\YourMembershipLaravelAPI\YourMembershipServiceProvider::class,


...
use CoolCodeMY\YourMembershipLaravelAPI\YMLA;

class YourController extends Controller {

    public function index(YMLA $ymla)
    {
        // Array results
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => '[email protected]',
            'Password' => 'password',
        ])->toArray();
        
        // JSON/Object result
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => '[email protected]',
            'Password' => 'password',
        ])->toJson();
        
        // XML result
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => '[email protected]',
            'Password' => 'password',
        ])->toXML();
    }
    ...
}

...
$result = $ymla->call('Auth.Authenticate', [
    'Username' => '[email protected]',
    'Password' => 'password',
])->toXML();

return response()->xml($result);
...
bash
php artisan vendor:publish --provider="CoolCodeMY\YourMembershipLaravelAPI\YourMembershipServiceProvider"