PHPackages                             offload-project/laravel-invite-only - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. offload-project/laravel-invite-only

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

offload-project/laravel-invite-only
===================================

A Laravel package for managing user invitations with polymorphic relationships, token-based access, scheduled reminders, and event-driven notifications.

v2.1.0(4mo ago)694.4k↑93.3%21MITPHPPHP ^8.2CI passing

Since Dec 28Pushed 4mo agoCompare

[ Source](https://github.com/offload-project/laravel-invite-only)[ Packagist](https://packagist.org/packages/offload-project/laravel-invite-only)[ Docs](https://github.com/offload-project/laravel-invite-only)[ RSS](/packages/offload-project-laravel-invite-only/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (4)Used By (1)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/f1e32d3dac2c7d18707075ff03f3106d8aea8d6fc0d1619c1c235e79e65a7a6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/offload-project/laravel-invite-only) [![GitHub Tests Action Status](https://camo.githubusercontent.com/60891e3a98bf3f40d54d27e6fe3a6d32522fffee2cf9c42c4ad87e2543e10026/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/offload-project/laravel-invite-only/actions) [![Total Downloads](https://camo.githubusercontent.com/1b38ff058779209911cef4c7b01d854f34fb528b96730f02adf6c7381a564b8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/offload-project/laravel-invite-only)

Laravel Invite Only
===================

[](#laravel-invite-only)

A Laravel package for managing user invitations with polymorphic relationships, token-based access, scheduled reminders, and event-driven notifications.

Features
--------

[](#features)

- **Polymorphic invitations** - Invite users to any model (teams, organizations, projects)
- **Bulk invitations** - Invite multiple users at once with partial failure handling
- **Token-based secure links** - Shareable invitation URLs with secure tokens
- **Status tracking** - Pending, accepted, declined, expired, and cancelled states
- **Automatic reminders** - Scheduled reminder emails for pending invitations
- **Event-driven** - Events fired for all invitation lifecycle changes
- **Structured exceptions** - Error codes and resolution hints for easy debugging

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.0 or 12.0

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

[](#installation)

```
composer require offload-project/laravel-invite-only

php artisan vendor:publish --tag="invite-only-config"
php artisan vendor:publish --tag="invite-only-migrations"
php artisan migrate
```

Quick Start
-----------

[](#quick-start)

### 1. Add Traits

[](#1-add-traits)

```
// Team.php (or any model that can have invitations)
use OffloadProject\InviteOnly\Traits\HasInvitations;

class Team extends Model
{
    use HasInvitations;
}
```

```
// User.php
use OffloadProject\InviteOnly\Traits\CanBeInvited;

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

### 2. Send Invitations

[](#2-send-invitations)

```
// Single invitation
$team->invite('user@example.com', [
    'role' => 'member',
    'invited_by' => auth()->user(),
]);

// Bulk invitations
$result = $team->inviteMany(
    ['one@example.com', 'two@example.com', 'three@example.com'],
    ['role' => 'member', 'invited_by' => auth()->user()]
);

$result->successful;  // Collection of created invitations
$result->failed;      // Collection of failures with reasons
```

### 3. Handle Acceptance

[](#3-handle-acceptance)

```
use OffloadProject\InviteOnly\Events\InvitationAccepted;

Event::listen(InvitationAccepted::class, function ($event) {
    $team = $event->invitation->invitable;
    $user = $event->user;
    $role = $event->invitation->role;

    $team->users()->attach($user->id, ['role' => $role]);
});
```

### 4. Schedule Reminders (Optional)

[](#4-schedule-reminders-optional)

```
// routes/console.php
Schedule::command('invite-only:send-reminders --mark-expired')->daily();
```

Documentation
-------------

[](#documentation)

- **[Getting Started](docs/getting-started.md)** - Step-by-step tutorial
- **[API Reference](docs/reference.md)** - All methods, events, and configuration
- **[Concepts](docs/concepts.md)** - Lifecycle, architecture, and design decisions

### How-To Guides

[](#how-to-guides)

- [Team Invitations](docs/howto/team-invitations.md)
- [Custom Notifications](docs/howto/custom-notifications.md)
- [Handling Errors](docs/howto/handling-errors.md)

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance76

Regular maintenance activity

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~5 days

Total

3

Last Release

131d ago

Major Versions

v1.0.0 → v2.0.02026-01-07

PHP version history (2 changes)v1.0.0PHP ^8.4

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/331bcc01f75f46dded875d74f3db055da6d74be5f8820f0a29105c6a2cd8afc8?d=identicon)[shavonn](/maintainers/shavonn)

---

Top Contributors

[![shavonn](https://avatars.githubusercontent.com/u/3074595?v=4)](https://github.com/shavonn "shavonn (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![pou](https://avatars.githubusercontent.com/u/1508526?v=4)](https://github.com/pou "pou (1 commits)")

---

Tags

laravelnotificationsUser managementInviteremindersinvitationspolymorphicInvitationteam-invites

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/offload-project-laravel-invite-only/health.svg)

```
[![Health](https://phpackages.com/badges/offload-project-laravel-invite-only/health.svg)](https://phpackages.com/packages/offload-project-laravel-invite-only)
```

###  Alternatives

[junaidnasir/larainvite

Laravel Invitation package, existing users can invite others by email

142119.9k](/packages/junaidnasir-larainvite)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[yajra/laravel-acl

Laravel ACL is a simple role, permission ACL for Laravel Framework.

112103.9k1](/packages/yajra-laravel-acl)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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