karabinse/laravel-user-invitation

User invitation for Laravel using built in PasswordBroker
5,728 1
Install
composer require karabinse/laravel-user-invitation
Latest Version:1.2.1
PHP:^8.2
License:MIT
Last Updated:Aug 22, 2025
Links: GitHub  ·  Packagist
Maintainer: Albin N

User invitation for Laravel using built in PasswordBroker

Latest Version on Packagist GitHub Tests Action Status

Installation

You can install the package via composer:

composer require karabinse/laravel-user-invitation

You can publish and run the migrations with:

php artisan vendor:publish --tag="laravel-user-invitation-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="laravel-user-invitation-config"

This is the contents of the published config file:

return [
    'notification_class' => \Karabin\UserInvitation\Notifications\InvitationNotification::class,
    'notification_subject' => 'Registered account',
    'notification_text' => "You're receiving this message because someone has registered an account for you on ".config('app.name').'. Click the link below to complete the registration by choosing a password',
    'notification_action_text' => 'Complete registration',
    'route' => 'register-user.create',
    'users_registration' => [
        'provider' => 'users',
        'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
        'expire' => env('USER_INVITATION_EXPIRE', (60 * 24) * 7),
        'throttle' => 60,
    ],
];

Usage

Add the trait

<?php

namespace Karabin\UserInvitation\Tests\Fixtures;

//...
use Karabin\UserInvitation\Traits\Inviteable;

class User extends AuthUser
{
    use Inviteable, Notifiable;
}

This gives access to two functions

<?php

$user->createTokenForRegistration() // Returns a token string

$user->sendInvitation() // Creates a token and sends a notification

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608