PHP code example of glaivepro / invytr

1. Go to this page and download the library: Download glaivepro/invytr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

glaivepro / invytr example snippets


// $user must extend Illuminate\Foundation\Auth\User
// Laravel's \App\User does this by default

\Invytr::invite($user);

'passwords' => [
	'users' => [
		'provider' => 'users',
		'table' => 'password_resets',
		'expire' => 60,
		'invites_expire' => 4320,  // This let's invites be valid for 3 days
	],
],

public function sendPasswordSetNotification($token)
{
	// By default we send this:
	\Notification::send($this, new \GlaivePro\Invytr\Notifications\SetPassword($token));
}

// in the ResetPasswordController

public function reset(Request $request)
{
	// something something
	
	if ($request->session()->has('invytr'))
	{
		// this is an invited user setting the password
	}
	
	// something else
}