PHPackages                             minutemailer/laravel-honeypot - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. minutemailer/laravel-honeypot

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

minutemailer/laravel-honeypot
=============================

Flexible credits for Laravel

v1.0.0(3y ago)28.1kMITPHPPHP &gt;=8.1CI failing

Since Nov 8Pushed 3y ago3 watchersCompare

[ Source](https://github.com/minutemailer/laravel-honeypot)[ Packagist](https://packagist.org/packages/minutemailer/laravel-honeypot)[ RSS](/packages/minutemailer-laravel-honeypot/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (14)Used By (0)

Credits for Laravel
===================

[](#credits-for-laravel)

Honeypot is a simple credit system for Laravel. With Honeypot, users can have credit buckets where credits can be deposited to or withdrawn from. It's perfect for creating simple virtual currency systems or implementing reward programs.

With Honeypot, you can easily manage credits for your users and keep track of all transactions. Whether you're building an e-commerce platform or a social network, Honeypot makes it easy to add a credit system to your Laravel application.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require minutemailer/laravel-honeypot
```

The `HoneypotServiceProvider` will be auto-discovered and registered by Laravel.

Next, create and run the database migration:

```
php artisan honeypot:migration:make
php artisan migrate
```

Finally add the `CanHaveCredits` trait to your `User` model:

```
use Minutemailer\Honeypot\Traits\CanHaveCredits;

class User extends Authenticatable
{
    use CanHaveCredits;
}
```

Usage
-----

[](#usage)

In Honeypot, credit buckets must have a name, but you can also choose to set an expiration date for each bucket. If no expiration date is set, the bucket will remain active indefinitely. Additionally, you have the option to set a validity date for each bucket.

### Creating a bucket

[](#creating-a-bucket)

To create a bucket, use the `addCreditBucket` method on the `User` model:

```
$user->addCreditBucket('credits', [
    'expires_at' => now()->addYear(), // Optional, defaults to null
    'valid_from' => now()->subYear(), // Optional, defaults to null
    'amount' => 1000 // Optional, defaults to 0
]);
```

The name is unique for each user, so you can't create two buckets with the same name for the same user.

### Depositing credits

[](#depositing-credits)

To deposit credits to a bucket, you need to select the bucket by name and then call the `add` method on the bucket:

```
$user->getCreditBucket('credits')->add(100);
```

### Using credits

[](#using-credits)

Same as depositing, but use the `use` method instead:

```
$user->getCreditBucket('credits')->use(100);
```

Using credits will increment the `used` column on the bucket and keep the `amount` column intact.

### Default bucket

[](#default-bucket)

Depending on your application, you might want to utilize the default bucket. You might only have one type of credits but multiple types of buckets. Say for example **earned credits** and **bought credits**. The default bucket is the bucket with the shortest expiration date. This helps the user to use the credits that are about to expire first.

Therefor, you could use this logic to dynamically withdraw credits from the user:

```
$creditsToWithdraw = 100;

while ($creditsToWithdraw > 0) {
    $bucket = $user->getDefaultCreditBucket();

    if ($bucket->amount > $creditsToWithdraw) {
        $bucket->use($creditsToWithdraw);
        $creditsToWithdraw = 0;
    } else {
        $creditsToWithdraw -= $bucket->amount;
        $bucket->use($bucket->amount);
    }
}
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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

Every ~104 days

Recently: every ~268 days

Total

13

Last Release

1178d ago

Major Versions

v0.7.0 → v1.0.02023-04-14

PHP version history (4 changes)v0.1.0PHP &gt;=7.0

v0.2.0PHP &gt;=7.1

v0.7.0PHP &gt;=8.0

v1.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba5368b7962de41c83857e95e2c792b7e7350d3e76f1c49a9229f75c991789ea?d=identicon)[minutemailer](/maintainers/minutemailer)

![](https://www.gravatar.com/avatar/d3fb3136a5c0b3b4b97ded82cd57a041b964531fa629479a17de3c065a5ce016?d=identicon)[carlos-ea](/maintainers/carlos-ea)

---

Top Contributors

[![carlos-ea](https://avatars.githubusercontent.com/u/5512089?v=4)](https://github.com/carlos-ea "carlos-ea (45 commits)")[![tbleckert](https://avatars.githubusercontent.com/u/263465?v=4)](https://github.com/tbleckert "tbleckert (5 commits)")

---

Tags

creditslaravellaravelcredits

### Embed Badge

![Health badge](/badges/minutemailer-laravel-honeypot/health.svg)

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

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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