globalxtreme/open-api

GlobalXtreme Open API Package for Laravel

1.0.2 2023-06-23 08:15 UTC

This package is auto-updated.

Last update: 2024-12-23 11:28:20 UTC


README

Version Total Downloads License

Install with composer

To install with Composer, simply require the latest version of this package.

composer require globalxtreme/open-api

Using

  • For example, we'll generate new credential for Customer Support to CRM
  • [CRM & Customer Support] Publish the configuration to config/open-api.php file.
    php artisan vendor:publish --provider="GlobalXtreme\OpenAPI\OpenAPIServiceProvider" 
  • [CRM] Generate new credential "php artisan open-api-credential name?"
    php artisan open-api-credential customer-support 
  • [CRM] Copy credential to "config/open-api.php"
    'credentials' => [
    
        // Copy with the same name? "customer-support"
        'customer-support' => [
            'id' => env('OPEN_API_CUSTOMER_SUPPORT_ID', ''),
            'key' => env('OPEN_API_CUSTOMER_SUPPORT_KEY', '')
        ],
    
    ]
  • [CRM] Add credential to ".env"
    OPEN_API_CUSTOMER_SUPPORT_ID=<client-id>
    OPEN_API_CUSTOMER_SUPPORT_KEY=<client-key>
  • [Customer Support] Copy credential to service project / client configuration "config/open-api.php"
    'clients' => [
    
        'CRM' => [
            'host' => env('CRM_HOST', ''), // Server host
            'client-id' => env('CRM_CLIENT_ID', ''),
            'client-name' => env('CRM_CLIENT_NAME', ''),
            'client-secret' => env('CRM_CLIENT_SECRET', ''),
        ],
    
    ]
  • [Customer Support] Add credential to ".env" server project / client
    CRM_HOST=http://127.0.0.1/
    CRM_CLIENT_ID=<client-id>
    CRM_CLIENT_NAME=<client-name>
    CRM_CLIENT_SECRET=<client-public-key>