src/HiddenCaptcha.php
public static function render($mustBeEmptyField = '_username')
    {
        $ts = time();
        $random = Str::random(16);

        // Generate the token
        $token = [
            'timestamp'         => $ts,
            'session_id'        => session()->getId(),
            'ip'                => request()->ip(),
            'user_agent'        => request()->header('User-Agent'),
            'random_field_name' => $random,
            'must_be_empty'     => $mustBeEmptyField,
        ];

        // Encrypt the token
        $token = Crypt::encrypt(serialize($token));

        return (string) view('hiddenCaptcha::captcha', compact('mustBeEmptyField', 'ts', 'random', 'token'));
    }
public static function render($mustBeEmptyField = '_username')
    {
        $ts = time();
        $random = Str::random(16);

        // Generate the token
        $token = [
            'timestamp'         => $ts,
            'session_id'        => session()->getId(),
            'ip'                => request()->ip(),
            'user_agent'        => request()->header('User-Agent'),
            'random_field_name' => $random,
            'must_be_empty'     => $mustBeEmptyField,
        ];

        // Encrypt the token
        $token = Crypt::encrypt(serialize($token));

        return (string) view('hiddenCaptcha::captcha', compact('mustBeEmptyField', 'ts', 'random', 'token'));
    }
public static function render ( $ mustBeEmptyField = '_username' ) { $ ts = time ( ) ; $ random = Str :: random ( 16 ) ; // Generate the token $ token = [ 'timestamp' => $ ts , 'session_id' => session ( ) -> getId ( ) , 'ip' => request ( ) -> ip ( ) , 'user_agent' => request ( ) -> header ( 'User-Agent' ) , 'random_field_name' => $ random , 'must_be_empty' => $ mustBeEmptyField , ] ; // Encrypt the token $ token = Crypt :: encrypt ( serialize ( $ token ) ) ; return ( string ) view ( 'hiddenCaptcha::captcha' , compact ( 'mustBeEmptyField' , 'ts' , 'random' , 'token' ) ) ; }
Set the hidden captcha tags to put in your form.

@param string $mustBeEmptyField

@return string
Set the hidden captcha tags to put in your form .