PHPackages                             glaivepro/invytr - 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. glaivepro/invytr

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

glaivepro/invytr
================

Laravel package for inviting users

1.0.11(1y ago)7910.4k↑753.8%4MITPHPCI failing

Since Feb 2Pushed 1y ago5 watchersCompare

[ Source](https://github.com/GlaivePro/Invytr)[ Packagist](https://packagist.org/packages/glaivepro/invytr)[ Docs](https://github.com/GlaivePro/Invytr)[ RSS](/packages/glaivepro-invytr/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

Invytr
======

[](#invytr)

[![Build Status](https://camo.githubusercontent.com/e20e60ce24c204b6f4e3b2073b440d20809487f771b39b59b262110df09faebb/68747470733a2f2f7472617669732d63692e6f72672f476c6169766550726f2f496e767974722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GlaivePro/Invytr)

When making a website where users are created instead of registering themselves, you are faced with the challenge of safely giving users the access to their newly created accounts. Invytr solves this task by sending an email with a link that will enable user to set a password for the account.

This package is mainly intended to be used together with Laravel's auth scaffolding and password resetting mechanism.

Usage
-----

[](#usage)

Install it:

```
$ composer require glaivepro/invytr
```

You can now send invitations to your users. They will receive an email with a link for the password setting.

```
// $user must extend Illuminate\Foundation\Auth\User
// Laravel's \App\User does this by default

\Invytr::invite($user);
```

Customization
-------------

[](#customization)

### Invite expiration

[](#invite-expiration)

By default invite tokens will expire in the same time as password resets. The default of 60 minutes is usually not enough for invited users as they might not sign up immediately after their invite is sent.

To increase the expiration time for invites, you should add key `invites_expire` in `passwords.users` within `config/auth.php`. No you don't have to publish anything. Just add the time in minutes like this:

```
'passwords' => [
	'users' => [
		'provider' => 'users',
		'table' => 'password_resets',
		'expire' => 60,
		'invites_expire' => 4320,  // This let's invites be valid for 3 days
	],
],
```

### Custom texts and localization

[](#custom-texts-and-localization)

You can customize/localize the strings in your JSON localization files (found in `resources/lang`).

The invite email uses the following strings:

- `Account created` as the subject.
- `An account for you has been created! Please set a password for your account!` as the text.
- `Set Password` as the action link.

The password setting page uses only a single string:

- `Set Password` as the title of the panel (instead of `Reset Password`).

Responses to setting attempts uses these strings:

- `Your password has been set!`
- `Passwords must be at least six characters and match the confirmation.`
- `This token is invalid.`
- `We can't find a user with that e-mail address.`

### Email

[](#email)

Similar to Laravel's reset password functionality, you can create a `sendPasswordSetNotification` method on your user model.

```
public function sendPasswordSetNotification($token)
{
	// By default we send this:
	\Notification::send($this, new \GlaivePro\Invytr\Notifications\SetPassword($token));
}
```

### View

[](#view)

By default this package uses the same `auth.passwords.reset` view as the Laravel's reset functionality. If you want more customization, make a `auth.passwords.set` view that includes all the same fields and posts the same request as does `auth.passwords.reset`.

### Password setting and responses

[](#password-setting-and-responses)

The resets are going through Laravel's `password.update` route and handled by the `reset` method on `App\Http\Controllers\Auth\ResetPasswordController`.

If you want to customize the handling and/or responses, edit that method. You can tell apart setting and resetting requests by checking the session.

```
// in the ResetPasswordController

public function reset(Request $request)
{
	// something something

	if ($request->session()->has('invytr'))
	{
		// this is an invited user setting the password
	}

	// something else
}
```

Warning
-------

[](#warning)

Doing `php artisan auth:clear-resets` will also flush your invite tokens if they are expired according to `auth.passwords.users.expire` config value. Your `auth.passwords.users.invites_expire` config value will be ignored.

Change log
----------

[](#change-log)

1.0 is the inital version of this package. Laravel 5.7 with PHP7.1 and PHP7.2 supported.

See [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

TODO
----

[](#todo)

Add a trait that sets a random password and sends an invite when creating a new user.

Try to set expiration by tinkering with `created_at` when making a token instead of how it's done now.

Publish language files?

Improve testing,

- Thoroughly cover Invytr, Controller, Middleware with unit tests
- Unit test the URL made in the notification
- Create more feature tests. For the pw setting page.

Improve code quality and consistency:

- fix docblocks
- imports vs fully qualified class names
- sort the imports
- alignment when chaining... maybe use styleCI?
- braces vs no braces for single line control structures
- helpers vs facades vs ...
- example: config() vs $request-&gt;session() vs \\View::

Maybe expand the scope to also provide something like a MustResetPasswordOnNextVisit trait? Or that's another package?

License
-------

[](#license)

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

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance49

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~212 days

Recently: every ~470 days

Total

12

Last Release

371d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16481303?v=4)[Džuris](/maintainers/tontonsb)[@tontonsb](https://github.com/tontonsb)

![](https://avatars.githubusercontent.com/u/6144184?v=4)[Larzs](/maintainers/Larzs)[@Larzs](https://github.com/Larzs)

---

Top Contributors

[![tontonsb](https://avatars.githubusercontent.com/u/16481303?v=4)](https://github.com/tontonsb "tontonsb (63 commits)")[![Larzs](https://avatars.githubusercontent.com/u/6144184?v=4)](https://github.com/Larzs "Larzs (56 commits)")[![francislavoie](https://avatars.githubusercontent.com/u/2111701?v=4)](https://github.com/francislavoie "francislavoie (6 commits)")[![amaelftah](https://avatars.githubusercontent.com/u/17250137?v=4)](https://github.com/amaelftah "amaelftah (1 commits)")

---

Tags

hacktoberfestinvite-tokenslaravellaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glaivepro-invytr/health.svg)

```
[![Health](https://phpackages.com/badges/glaivepro-invytr/health.svg)](https://phpackages.com/packages/glaivepro-invytr)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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