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.7(2mo ago)12MITPHPPHP &gt;=8.2

Since Aug 14Pushed 2mo 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 1mo ago

READMEChangelog (7)Dependencies (3)Versions (10)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 &amp; 12
- 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

40

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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 ~35 days

Recently: every ~52 days

Total

7

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/280b020ca627b367261832c86f63f9f71076d720e1f8e6c4a7ae2c9c1a77f39e?d=identicon)[MattYeend](/maintainers/MattYeend)

---

Top Contributors

[![MattYeend](https://avatars.githubusercontent.com/u/23270321?v=4)](https://github.com/MattYeend "MattYeend (9 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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[tomshaw/electricgrid

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

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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