Download the PHP package mathewparet/laravelinvites without Composer
On this page you can find all versions of the php package mathewparet/laravelinvites. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mathewparet/laravelinvites
More information about mathewparet/laravelinvites
Files in mathewparet/laravelinvites
Package laravelinvites
Short Description :description
License MIT
Homepage https://github.com/mathewparet/laravel-invites
Informations about the package laravelinvites
mathewparet/LaravelInvites
A Laravel package that helps manage invitation based user registration.
Project Status
master
develop
Introduction
This package generates invitation codes for you to use along with registration form.
Invitation codes can
- be tied to an email address.
- be available for multiple uses (got to post on FB!).
- have defined limit for the number of times it can be used.
- can have an expiry date or never.
- can have a future activation date (before which the code cannot be used).
Installation
You can install the package using composer.
For Laravel 5.5 or before, you will need to add:
For ease of use you can define an alias too:
Finally run the migration:
Publish Configuration
You may want to publish the configuration files if you want to customize it, or if you want to change the name of the table that will be created to store the invites.
This will copy the configuration file () to your config directory.
The default table name is . If you wish to change it, you can change it in the above configuraion file before running the migration.
Usage
Generate a single onetime use invitation code
Generate multiple onetime use invitation code
Generate a multi use invitation code
Override expiry date defined in the config making a non-expiry code
If you always plan to use invitation codes that never expire then you can make changes in the configuration file. If the = "never"
then you don't need to use explicitly.
Override expiry date defined in the config with a specific expiry date
Set an active / start date
OR
Generate an email ID specific invitation code
OR
Check whether an invitation code is valid
OR
This method returns or .
If an invitation code tied to a sepcific email is checked without the correct email ID, it would return false.
If invitation code is not tied to an email ID, and the invitation code is active and correct, this method will return true whether email ID is null not.
Check validity of invitation code with exceptions
OR
This works just like but instead it throws an exception if validation fails.
Redeem invitation code
OR
should be called before invoking this since it will throw an exception if invitation code is invalid.
Get list of invitation codes
OR
Form request validation
To validate an invitation code submitted via form:
Console
The below console commands are available.
Email with Invitation Code
When invitation code is generated for a specific email ID (using or using the Facade), an invitation mail will be automatically sent to the email ID.
You can disable, customize this in the configuraiton file.
If it is enabled, then when a user clicks on the invitation link, his email ID and invitation code will be automatically filled in your registration form. It will work out of the box if you use the built in registration form that comes with Laravel. Else you can customize the route name for the registration form under . You can customize and fields names as in your registration form so that it can be auto populated.
You can publish the mail mail markdown if you wish to customize it:
php artisan vendor:publish --provider="mathewparet\LaravelInvites\LaravelInvitesServiceProvider" --tag=mail