PHP code example of karabinse / laravel-user-invitation

1. Go to this page and download the library: Download karabinse/laravel-user-invitation 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/ */

    

karabinse / laravel-user-invitation example snippets


return [
    'notification_class' => \Karabin\UserInvitation\Notifications\InvitationNotification::class,
    'notification_subject' => 'Registered account',
    'notification_text' => "You're receiving this message because someone has registered an account for you on ".config('app.name').'. Click the link below to complete the registration by choosing a password',
    'notification_action_text' => 'Complete registration',
    'route' => 'register-user.create',
    'users_registration' => [
        'provider' => 'users',
        'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
        'expire' => env('USER_INVITATION_EXPIRE', (60 * 24) * 7),
        'throttle' => 60,
    ],
];




namespace Karabin\UserInvitation\Tests\Fixtures;

//...
use Karabin\UserInvitation\Traits\Inviteable;

class User extends AuthUser
{
    use Inviteable, Notifiable;
}




$user->createTokenForRegistration() // Returns a token string

$user->sendInvitation() // Creates a token and sends a notification

bash
php artisan vendor:publish --tag="laravel-user-invitation-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="laravel-user-invitation-config"