Skip to content
forked from Atbox/invi-l5

A simple invitation system api for laravel 5

Notifications You must be signed in to change notification settings

sigmoidal/invi-l5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invi Package for Laravel 5

This package help you to make a simple invitation system for your signup or other services. [https://packagist.org/packages/atbox/invi]

Features

  • Generate invitation code with email.
  • Set expiration date
  • Active or deactive invite
  • Use it,unsed it or delete it

Installation

add this to composer.json require:

"atbox/invi": "dev-master"

execute:

composer update

add this to app/config/app.php end of providers array:

Atbox\Invi\InviServiceProvider::class,

add this to config/app.php end of aliases array:

'Invi'      => Atbox\Invi\Facades\Invi::class,

Publish migration file:

php artisan vendor:publish

Run migration command:

php artisan migrate

Examples

Invi::generate("[email protected]","2 day",True); // Generate Invitation

if(Invi::check("f22c597305eb1800","[email protected]"))
	Invi::used("f22c597305eb1800","[email protected]");
else
	echo Invi::status("f22c597305eb1800","[email protected]");

Functions

generate

generate an invitation code

  • Arguments:
    • email
    • expiration date : 2 year 2 month 13 day 1 hour 23 min 40 sec
    • active
  • Return:
    • A jSon array of all invitation information
Invi::generate("[email protected]","2 day",True); // Generate Invitation
  • Output:
{"code":"f22c5973ebbcca99","email":"[email protected]","expiration":"2013-05-10 15:58:41 ","active":true,"used":"0"}

check

validate invitation code

  • Argouments:
    • invitation code
    • email
  • Return:
    • Boolean
Invi::check("f22c597305eb1800","[email protected]");

status

return invitation code status

  • Argouments:
    • invitation code
    • email
  • Return:
    • Status : Active,Deactive,Used,Valid,Not Exist
echo Invi::status("f22c597305eb1800","[email protected]");

active

activate an invitation

  • Argouments:
    • invitation code
    • email
Invi::active("f22c597305eb1800","[email protected]");

deactive

deactivate an invitation

  • Argouments:
    • invitation code
    • email
Invi::deactive("f22c597305eb1800","[email protected]");

used

make an invitation used

  • Argouments:
    • invitation code
    • email
Invi::used("f22c597305eb1800","[email protected]");

unused

make an invitation unused

  • Argouments:
    • invitation code
    • email
Invi::unused("f22c597305eb1800","[email protected]");

delete

delete an invitation

  • Argouments:
    • invitation code
    • email
Invi::delete("f22c597305eb1800","[email protected]");

License

The MIT License (MIT)

Copyright (c) 2016 Atbox

http://atbox.io https://github.com/atbox/invi-l5

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://opensource.org/licenses/MIT

About

A simple invitation system api for laravel 5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%