public function newToken(array $content = [], $expire = null)
    {
        $entity = $this->newEntity([
            'id' => $this->uniqId(),
            'content' => $content,
            'expire' => is_null($expire) ? Chronos::parse('+1 day') : Chronos::parse($expire),
        ]);

        $this->save($entity);

        return $entity->id;
    }
public function newToken(array $content = [], $expire = null)
    {
        $entity = $this->newEntity([
            'id' => $this->uniqId(),
            'content' => $content,
            'expire' => is_null($expire) ? Chronos::parse('+1 day') : Chronos::parse($expire),
        ]);

        $this->save($entity);

        return $entity->id;
    }
public function newToken ( array $ content = [ ] , $ expire = null ) { $ entity = $ this -> newEntity ( [ 'id' => $ this -> uniqId ( ) , 'content' => $ content , 'expire' => is_null ( $ expire ) ? Chronos :: parse ( '+1 day' ) : Chronos :: parse ( $ expire ) , ] ) ; $ this -> save ( $ entity ) ; return $ entity -> id ; }
create token with option
@param  array        $content token content (custom)
@param  null|date    $expire  expire date or null
@return string                token id
create token with option