PHPackages                             bensondevs/laravel-mayar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. bensondevs/laravel-mayar

ActiveLibrary[Database &amp; ORM](/categories/database)

bensondevs/laravel-mayar
========================

Laravel integration for the Mayar Headless API.

v0.1.0(2w ago)010MITPHPPHP ^8.3

Since May 20Pushed 2w agoCompare

[ Source](https://github.com/bensondevs/laravel-mayar)[ Packagist](https://packagist.org/packages/bensondevs/laravel-mayar)[ RSS](/packages/bensondevs-laravel-mayar/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Laravel Mayar
=============

[](#laravel-mayar)

Laravel integration for the [Mayar Headless API](https://docs.mayar.id/api-reference/introduction).

✨ Highlights
------------

[](#-highlights)

- Laravel-friendly API client with Eloquent-like resources.
- Supports products, invoices, payment requests, installments, discounts, customers, transactions, webhooks, and reviews.
- Includes SaaS/license and credit-based workflows.
- Designed for sandbox and production modes.

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Requirements](#requirements)
- [Install](#install)
- [Configuration](#configuration)
- [Quick Usage](#quick-usage)
- [Features](#features)
- [Full Documentation](#full-documentation)
- [Laravel Boost (AI Guideline)](#laravel-boost-ai-guideline)
- [Develop and Test](#develop-and-test)
- [License](#license)

✅ Requirements
--------------

[](#-requirements)

RequirementNotesPHP8.3+Laravel10–13 with matching `illuminate/*` componentsMayar account[Production](https://web.mayar.id/api-keys) or [sandbox](https://web.mayar.club/api-keys) API key

📦 Install
---------

[](#-install)

```
composer require bensondevs/laravel-mayar
```

Publish configuration (optional):

```
php artisan vendor:publish --tag=mayar-config
```

⚙️ Configuration
----------------

[](#️-configuration)

Add to your `.env`:

```
MAYAR_API_KEY=your-api-key
MAYAR_MODE=sandbox
```

VariableDescription`MAYAR_API_KEY`API key from the Mayar dashboard (sandbox or production portal)`MAYAR_MODE``sandbox` (default) or `production`Use a key issued from the portal that matches your mode.

🚀 Quick Usage
-------------

[](#-quick-usage)

```
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);
```

```
use Bensondevs\Mayar\Api\Invoices\Invoice;

$invoice = Invoice::create([
    'name' => 'Customer name',
    'email' => 'customer@example.com',
    'mobile' => '081234567890',
    'description' => 'Order notes',
    'items' => [
        ['quantity' => 1, 'rate' => 10000, 'description' => 'Item description'],
    ],
]);
```

🧩 Features
----------

[](#-features)

- `Products`: list/search/detail/close/re-open.
- `Software License Codes`: license verification for software products.
- `SaaS Membership`: verify, activate, deactivate licenses.
- `Credit Membership`: balance/history/spend/add-credit/register customer.
- `Credit Based Product`: credit usage workflows and immutable checkout.
- `Invoices`: create/edit/list/filter/detail/close/re-open.
- `Payment Requests`: create/edit/list/filter/detail/close/re-open.
- `Installments`: create and detail.
- `Discounts`: create/validate/detail.
- `Customers`: list, search by email, create, update email, portal link.
- `Transactions`: balance, unpaid list, daily stats, dynamic QR.
- `Webhooks`: history, register, test, retry.
- `Webhook Receiver`: inbound webhook controller with event-driven listener handling and DTO payload access.
- `Reviews`: paginated list.

📘 Full Documentation
--------------------

[](#-full-documentation)

Complete feature docs are available in dedicated files under [`docs/`](./docs/README.md):

- [🛍️ Products](./docs/products.md)
- [🔑 Software License Codes](./docs/software-license-codes.md)
- [☁️ SaaS Membership](./docs/saas-membership.md)
- [💳 Credit Membership](./docs/credit-membership.md)
- [⚡ Credit Based Product](./docs/credit-based-product.md)
- [🧾 Invoices](./docs/invoices.md)
- [💸 Payment Requests](./docs/payment-requests.md)
- [🧩 Installments](./docs/installments.md)
- [🏷️ Discounts](./docs/discounts.md)
- [👤 Customers](./docs/customers.md)
- [📊 Transactions](./docs/transactions.md)
- [🪝 Webhooks](./docs/webhooks.md)

Webhook docs now include a complete inbound receiver guide (optional package route or manual route registration), event-listener wiring for all documented Mayar webhook event types, and DTO-based payload handling.

- [⭐ Reviews](./docs/reviews.md)

🤖 Laravel Boost (AI Guideline)
------------------------------

[](#-laravel-boost-ai-guideline)

This package ships a Laravel Boost third-party guideline at:

- `resources/boost/guidelines/core.blade.php`

When this package is installed in a Laravel app that uses Boost, running `php artisan boost:install` (or `php artisan boost:update`) allows Boost-aware AI agents to load this package-specific guidance.

🧪 Develop and Test
------------------

[](#-develop-and-test)

```
composer install
composer test
```

Tests use `Http::fake()` and do not call the live Mayar API.

📄 License
---------

[](#-license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6953e310af7dc10b68168564e03f24bfcc36b8dd0830dea1d1696f50cda16fff?d=identicon)[bensondevs](/maintainers/bensondevs)

---

Top Contributors

[![bensondevs](https://avatars.githubusercontent.com/u/76855099?v=4)](https://github.com/bensondevs "bensondevs (22 commits)")

---

Tags

eloquentlaravellaravel-packagemayarmayar-php

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bensondevs-laravel-mayar/health.svg)

```
[![Health](https://phpackages.com/badges/bensondevs-laravel-mayar/health.svg)](https://phpackages.com/packages/bensondevs-laravel-mayar)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8455.5M96](/packages/laravel-doctrine-orm)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8733.1M23](/packages/yajra-laravel-oci8)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

719160.4k12](/packages/tallstackui-tallstackui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
