Manage Invite Codes for Your Laravel Applications
Published on by Paul Redmond
Laravel Invite Codes is a package by Mateus Junges that allows you to manage invite codes for your Laravel application easily. It works by configuring a middleware that validates an invite code before accessing a route:
Route::get('/protected-route', function() { //})->middleware('protected_by_invite_codes');
You can generate an invite code using the following API, restricting this code to a specific user account:
use \Junges\InviteCodes\Facades\InviteCodes; $invite_code = InviteCodes::create() ->expiresAt('2020-02-01') ->maxUsages(10) ->restrictUsageTo('contato@mateusjunges.com') ->save();
You can learn more about this package, get full installation instructions, and view the source code on GitHub at mateusjunges/laravel-invite-codes.