src/Breadcrumb.php
public function add($label, $url='')
    {
        if (is_array($label)) {
            if (count($label) > 0) foreach ($label as $crumb) {
                $defaults = [
                    'label' => '',
                    'url'   => ''
                ];
                $crumb = array_merge($defaults, $crumb);
                $this->add($crumb['label'], $crumb['url']);
            }
        } else {
            $label = trim(strip_tags($label, '<i><b><strong>'));
            if (! preg_match('|^http(s)?|', $url)) {
                $url = URL::to($url);
            }
            $this->crumbs[] = array('label' => $label, 'url' => $url);
        }

        return $this;
    }
public function add($label, $url='')
    {
        if (is_array($label)) {
            if (count($label) > 0) foreach ($label as $crumb) {
                $defaults = [
                    'label' => '',
                    'url'   => ''
                ];
                $crumb = array_merge($defaults, $crumb);
                $this->add($crumb['label'], $crumb['url']);
            }
        } else {
            $label = trim(strip_tags($label, '<i><b><strong>'));
            if (! preg_match('|^http(s)?|', $url)) {
                $url = URL::to($url);
            }
            $this->crumbs[] = array('label' => $label, 'url' => $url);
        }

        return $this;
    }
public function add ( $ label , $ url = '' ) { if ( is_array ( $ label ) ) { if ( count ( $ label ) > 0 ) foreach ( $ label as $ crumb ) { $ defaults = [ 'label' => '' , 'url' => '' ] ; $ crumb = array_merge ( $ defaults , $ crumb ) ; $ this -> add ( $ crumb [ 'label' ] , $ crumb [ 'url' ] ) ; } } else { $ label = trim ( strip_tags ( $ label , '<i><b><strong>' ) ) ; if ( ! preg_match ( '|^http(s)?|' , $ url ) ) { $ url = URL :: to ( $ url ) ; } $ this -> crumbs [ ] = array ( 'label' => $ label , 'url' => $ url ) ; } return $ this ; }
Add breadcrumb to array.

@param  mixed  $label
@param  string $url
@return Breadcrumb
Add breadcrumb to array .