PHP code example of diepxuan / laravel-magento

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

    

diepxuan / laravel-magento example snippets


use Diepxuan\Magento\Magento;
use Diepxuan\Magento\Magento2;

// Dùng Magento facade (static)
$products = Magento::products()->all();
$categories = Magento::categories()->all();

// Dùng Magento2 client (instance)
$magento = new Magento2();
$orders = $magento->orders()->all();
$customers = $magento->customers()->all();