LaravelFCM\Message\Topics::nest PHP Method

nest() public method

public nest ( Closure $callback, $condition )
$callback Closure
$condition
    public function nest(Closure $callback, $condition)
    {
        $topic = new static();
        $callback($topic);
        if (count($topic->conditions)) {
            $open_parenthesis = '(';
            $topic = $topic->conditions;
            $close_parenthesis = ')';
            $this->conditions[] = compact('condition', 'open_parenthesis', 'topic', 'close_parenthesis');
        }
        return $this;
    }