mostafax / dynamic
to connect dynamic
v2.0.0
2024-10-08 08:16 UTC
README
# Dynamic Package
Laravel service for connecting with Dynamic API.
To install the package via Composer, run the following command:
composer require mostafax/dynamic
To publish the package configuration, run:
php artisan vendor:publish
Add the following environment variables to your .env
file:
DYNAMIC_DOMAIN=http://domain DYNAMIC_TOKEN=******************************* DYNAMIC_TIMEOUT=60 DYNAMIC_TOKEN_STATUS='auto' or 'static'
If you need to generate a token with every request, add these variables as well:
TENANT_ID='' CLIENT_ID='' CLIENT_SECRET='' RESOURCE='' GRANT_TYPE=''
To use the package, include the namespace:
use Mostafax\Dynamic\Dynamic;
Handle the request data in the form of an array:
$data = [ // request parameters ];
To send data with a POST request:
$dynamic = new Dynamic(); $dynamic->postData("API Name", $data);
To retrieve data with a GET request:
$dynamic = new Dynamic(); $dynamic->getData("API Name", $data);
To collect the response data:
$dynamic = new Dynamic(); $response = $dynamic->getData("API Name", $data); $response->collect(); $response->json(); $response->body();
For any further support, email mostafa.m.elbiar@gmail.com.