1. Go to this page and download the library: Download bensondevs/laravel-mayar 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/ */
bensondevs / laravel-mayar example snippets
use Bensondevs\Mayar\Mayar;
use Bensondevs\Mayar\Enums\MayarMode;
use Bensondevs\Mayar\Api\Products\Product;
// Raw HTTP access (advanced)
$response = Mayar::client()->get(uri: 'customer', query: [
'page' => 1,
'pageSize' => 10,
]);
// Switch mode at runtime
Mayar::mode(MayarMode::Production);
// Eloquent-like resource usage
$products = Product::search(keyword: 'course')->paginate(page: 1, perPage: 10);