PHP code example of waltersilvacruz / laravel-meli
1. Go to this page and download the library: Download waltersilvacruz/laravel-meli 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/ */
namespace App\Http\Controllers;
use App\Http\Controllers\Controller
use WebDEV\Meli\Services\MeliApiService;
class HomeController extends Controller
{
public function index() {
// it's important to inform the same state used on connection link
$service = new MeliApiService('store-demo-1');
$data = $service->get('/users/me');
dd($data);
}
}
$service = new MeliApiService('1281300c-a19c-42e7-9de8-6d0badccc9ad');
// or
$service = new MeliApiService('115e1b1c-fa1b-4b6c-9781-aa2f4e5f2373');
// or
$service = new MeliApiService('f237ff76-963b-4dbc-b1d3-978d1534bf63');
// then you can perform queries
$order = $service->get('/orders/768570754');
dd($order->response);