PHP code example of ikoncept / product-manager-adapter

1. Go to this page and download the library: Download ikoncept/product-manager-adapter 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/ */

    

ikoncept / product-manager-adapter example snippets


return [
    'api_key' => env('PRODUCT_MANAGER_ADAPTER_KEY'),
    'endpoint' => env('PRODUCT_MANAGER_ADAPTER_ENDPOINT', 'https://products.malmsten.com')
];


// Get a tree node by ID. Usually when retrieving navigation on the front end
Route::get('/tree-nodes/{id}', [TreeNodeController::class, 'show']);

// Get a tree node via slug, usefull when retrieving a tree node from an url parameter
Route::get('/tree-nodes/{slug}/slug', [TreeNodeSlugsController::class, 'show']);

// Get a product with a specific SKU
Route::get('/products/{sku}', [ProductController::class, 'show']);

// Get a list of all available product trees
Route::get('/product-trees', [ProductTreeController::class, 'index']);

// Get a tree representation of a specific node
Route::get('/node-trees/{id}', [NodeTreeController::class, 'index']);
bash
php artisan vendor:publish --tag="product-manager-adapter-config"