Doorman is a Laravel package that allows you to limit access to your Laravel applications by using invite codes.
Once installed you can generate and redeem invites through the Doorman facade and it includes support for Form Request validation.
You can generate new invites like this:
// Generate a single invite
Doorman::generate()->make();
// Generate five invites
Doorman::generate()->times(5)->make();
// Make an invite that expires on a specific date.
$date = Carbon::now('UTC')->addDays(7);
Doorman::generate()->expiresOn($date)->make();
// Make an invite that expires in 14 days.
Doorman::generate()->expiresIn(14)->make();
// Or even bind it to a specific person
Doorman::generate()->for('me@example.org')->make();
Redeeming is just as simple:
Doorman::redeem('ABCDE');
// or
Doorman::redeem('ABCDE', 'me@example.org');
If you’d like to start a private invite system to your app check out the Doorman package on Github.
0 comments:
Post a Comment
Thanks