public function remove($tag)
    {
        if ($this->count() == 0) {
            return [$this, null];
        }

        $deleted = null;

        foreach ($this->items as $key => $element) {
            if ($element === $tag) {
                $this->forget($key);

                $deleted = $tag;

                break;
            }
        }

        return [$this, $deleted];
    }
public function remove($tag)
    {
        if ($this->count() == 0) {
            return [$this, null];
        }

        $deleted = null;

        foreach ($this->items as $key => $element) {
            if ($element === $tag) {
                $this->forget($key);

                $deleted = $tag;

                break;
            }
        }

        return [$this, $deleted];
    }
public function remove ( $ tag ) { if ( $ this -> count ( ) == 0 ) { return [ $ this , null ] ; } $ deleted = null ; foreach ( $ this -> items as $ key => $ element ) { if ( $ element === $ tag ) { $ this -> forget ( $ key ) ; $ deleted = $ tag ; break ; } } return [ $ this , $ deleted ] ; }
Remove tag element from collection

@param  Tag $tag

@return array
Remove tag element from collection