PHPackages                             mattyeend/guest-to-user-helper - 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. mattyeend/guest-to-user-helper

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

mattyeend/guest-to-user-helper
==============================

Guest-to-user migration helper for Laravel.

v1.1.8(2w ago)12MITPHPPHP &gt;=8.2

Since Aug 14Pushed 2w agoCompare

[ Source](https://github.com/MatthewYeend/GuestToUserHelper)[ Packagist](https://packagist.org/packages/mattyeend/guest-to-user-helper)[ Fund](https://www.buymeacoffee.com/mattyeend)[ GitHub Sponsors](https://github.com/MattYeend)[ RSS](/packages/mattyeend-guest-to-user-helper/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (5)Versions (11)Used By (0)

Laravel Guest Upgrade (Guest-to-User Migration Helper)
======================================================

[](#laravel-guest-upgrade-guest-to-user-migration-helper)

Features
--------

[](#features)

- Works with Laravel 10, 11, 12, &amp; 13
- Assigns a unique guest identifier
- Seamlessly migrates guest-owned models to a real user on registration/login
- Simple API, no deep integration needed

---

Install
-------

[](#install)

```
composer require MattYeend/guest-to-user-helper
php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=migrations
```

---

Middleware Registration
-----------------------

[](#middleware-registration)

Laravel 10 and 11

```
// app/Http/Kernel.php
protected $middlewareGroups = [
    'web' => [
        \MattYeend\GuestToUserHelper\Http\Middleware\AssignGuestIdentifier::class,
    ],
];
```

Laravel 12

```
// bootstrap/app.php
use MattYeend\GuestToUserHelper\Http\Middleware\AssignGuestIdentifier;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->group('web', [
            AssignGuestIdentifier::class,
        ]);
    })
    ->create();
```

---

Usage
-----

[](#usage)

Add `HasGuestOwnership` to any model you want to track for guests:

```
use MattYeend\GuestToUserHelper\Traits\HasGuestOwnership;

class Cart extends Model
{
    use HasGuestOwnership;
}
```

Migrate data after login/registration:

```
app(\MattYeend\GuestToUserHelper\GuestMigrator::class)->migrate(auth()->id());
```

Events available:

- `GuestMigrating`
- `GuestMigrated`

---

Testing
-------

[](#testing)

Run the included tests:

```
vendor/bin/phpunit
```

---

License
-------

[](#license)

This package is licensed under the MIT License.

---

Contributing
------------

[](#contributing)

Feel free to fork the repository and submit pull requests for improvements or new features!

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance96

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Every ~43 days

Recently: every ~74 days

Total

8

Last Release

20d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23270321?v=4)[Matt Yeend](/maintainers/MattYeend)[@MattYeend](https://github.com/MattYeend)

---

Top Contributors

[![MattYeend](https://avatars.githubusercontent.com/u/23270321?v=4)](https://github.com/MattYeend "MattYeend (10 commits)")

---

Tags

composercomposer-packageguestguest-to-userguest-to-user-helperlaravellaravel-10laravel-11laravel-12laravel-frameworklaravel-packagelaravel10laravel11laravel12packagephpuserlaravelhelperpackageuserguestGuest-To-User-Helper

### Embed Badge

![Health badge](/badges/mattyeend-guest-to-user-helper/health.svg)

```
[![Health](https://phpackages.com/badges/mattyeend-guest-to-user-helper/health.svg)](https://phpackages.com/packages/mattyeend-guest-to-user-helper)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[psalm/plugin-laravel

Psalm plugin for Laravel

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

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)

PHPackages © 2026

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