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.5.0(3w ago)729.3k↑113.3%31MITPHPPHP ^8.2CI passing

Since Dec 28Pushed 2w 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 4d ago

READMEChangelog (9)Dependencies (27)Versions (11)Used By (1)

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

[](#laravel-invite-only)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f1e32d3dac2c7d18707075ff03f3106d8aea8d6fc0d1619c1c235e79e65a7a6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/offload-project/laravel-invite-only)[![Tests](https://camo.githubusercontent.com/5c43a1114f4163e9c470a8f0340256a803563ebd4320c0109c83b63d693cb554/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/offload-project/laravel-invite-only/actions/workflows/tests.yml)[![Build](https://camo.githubusercontent.com/a220d93f854cef96ae8f81178ade4ced0f72bc0aeac67da21afc610a9ff025cd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792f72656c656173652e796d6c3f6c6162656c3d6275696c64267374796c653d666c61742d737175617265)](https://github.com/offload-project/laravel-invite-only/actions/workflows/release.yml)[![Total Downloads](https://camo.githubusercontent.com/1b38ff058779209911cef4c7b01d854f34fb528b96730f02adf6c7381a564b8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f66666c6f61642d70726f6a6563742f6c61726176656c2d696e766974652d6f6e6c792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/offload-project/laravel-invite-only)[![License: MIT](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

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
- **Translatable notifications** - All notification messages customizable via language files
- **Structured exceptions** - Error codes and resolution hints for easy debugging

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

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
    - [Add Traits](#1-add-traits)
    - [Send Invitations](#2-send-invitations)
    - [Handle Acceptance](#3-handle-acceptance)
    - [Schedule Reminders (Optional)](#4-schedule-reminders-optional)
- [Full Documentation](#full-documentation)
- [AI Coding Assistant Skill](#ai-coding-assistant-skill)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

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

[](#requirements)

- PHP 8.2+
- Laravel 11/12/13

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

If a model both sends and receives invitations (e.g. user-to-user friend invitations), apply both traits. The two traits each define an `acceptedInvitations()` method, so use PHP's trait conflict resolution:

```
use OffloadProject\InviteOnly\Traits\CanBeInvited;
use OffloadProject\InviteOnly\Traits\HasInvitations;

class User extends Authenticatable
{
    use HasInvitations, CanBeInvited {
        CanBeInvited::acceptedInvitations insteadof HasInvitations;
        HasInvitations::acceptedInvitations as acceptedInvitationsToModel;
    }
}
```

In v3.0 the `HasInvitations::acceptedInvitations()` helper will be removed in favour of `getAcceptedInvitations()`, eliminating the conflict — at which point the `insteadof`/`as` clauses can be dropped.

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

Full Documentation
------------------

[](#full-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)

AI Coding Assistant Skill
-------------------------

[](#ai-coding-assistant-skill)

This package ships a [Laravel Boost](https://skills.laravel.cloud/) skill so coding assistants (Claude Code, Cursor, etc.) follow the package's conventions when generating code. Install it in your app with:

```
php artisan boost:add-skill offload-project/laravel-invite-only
```

The skill source lives at [`skills/SKILL.md`](skills/SKILL.md).

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Contributions are welcome! Please see the documents below before getting started.

- [Contributing Guide](CONTRIBUTING.md) — setup, workflow, commit conventions, and PR process
- [Code of Conduct](CODE_OF_CONDUCT.md) — expectations for participation in this project

Security
--------

[](#security)

- [Security Policy](SECURITY.md) — how to report a vulnerability privately

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.5% 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 ~21 days

Total

9

Last Release

21d 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 (25 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 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

[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)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)

PHPackages © 2026

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