Require this package, with Composer, in the root directory of your project.
$ composer require artisanry/inviteable
To get started, you'll need to publish the vendor assets and migrate:
php artisan vendor:publish --provider="Artisanry\Inviteable\InviteableServiceProvider" && php artisan migrate
<?php
namespace App;
use Artisanry\Inviteable\HasInvites;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use HasInvites;
}
Invite::getNewCode([
'email' => 'test@test.io',
]);
Invite::getInviteByCode($invite->code);
Invite::getValidInviteByCode($invite->code);
$invite->claim($user);
if ($invite->claimed()) {
dd('This invite has already been claimed.');
}
dump($invite->claimer);
dump($user->invite);
$ phpunit
If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.
This project exists thanks to all the people who contribute.
Mozilla Public License Version 2.0 (MPL-2.0).