PHP code example of lampge / laravel-invitation

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

    

lampge / laravel-invitation example snippets


    $inviteCode = LaravelInvitation::generate()
                    ->setCode($code) // 指定邀请码,若不使用會自動隨機產生
                    ->status('enabled') // 是否開放使用,不使用預設為 enabled
                    ->belongTo($this->id) // 屬於特定代理 id
                    ->madeBy($this->id) // 製作者 id
                    ->expiresOn('2018-11-26 12:00:00') // 過期日期
                    ->type($type) // 此邀请码類型
                    ->make()
                    ->first();
    

        protected function schedule(Schedule $schedule)
        {
            ...
            // 每天清除已過期的邀请码
            $schedule->command('routine-clear:clear-expired-invite-codes')->daily();
            ...
        }