protected function setViewData($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $name => $data) {
                view()->share($name, $data);
            }
        } else {
            view()->share($key, $value);
        }
    }
protected function setViewData($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $name => $data) {
                view()->share($name, $data);
            }
        } else {
            view()->share($key, $value);
        }
    }
protected function setViewData ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ name => $ data ) { view ( ) -> share ( $ name , $ data ) ; } } else { view ( ) -> share ( $ key , $ value ) ; } }
Pass data to the view.

@param mixed $key
@param mixed $value
Pass data to the view .