src/Traits/Tokenable.php
public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
    {
        return $this->token()->create([
            'token'             => $this->generateTokenString($length),
            'expiration_date'   => Carbon::now()->addMinutes($expire),
            'type'              => $type,
            'custom_properties' => $customProperties,
        ]);
    }
public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
    {
        return $this->token()->create([
            'token'             => $this->generateTokenString($length),
            'expiration_date'   => Carbon::now()->addMinutes($expire),
            'type'              => $type,
            'custom_properties' => $customProperties,
        ]);
    }
public function createToken ( $ type , $ expire = 60 , $ length = 48 , $ customProperties = null ) { return $ this -> token ( ) -> create ( [ 'token' => $ this -> generateTokenString ( $ length ) , 'expiration_date' => Carbon :: now ( ) -> addMinutes ( $ expire ) , 'type' => $ type , 'custom_properties' => $ customProperties , ] ) ; }
Create new token and return the instance.
@param  string  $type   token type
@param  integer $expire expire in minutes
@param  integer $length key length
@return Token
Create new token and return the instance .