public function hasWidget($widget)
    {
        if ($widget instanceof Model) {
            $widget = $widget->id;
        }

        return $this->widgets()->where('widget_id', $widget)->exists();
    }
public function hasWidget($widget)
    {
        if ($widget instanceof Model) {
            $widget = $widget->id;
        }

        return $this->widgets()->where('widget_id', $widget)->exists();
    }
public function hasWidget ( $ widget ) { if ( $ widget instanceof Model ) { $ widget = $ widget -> id ; } return $ this -> widgets ( ) -> where ( 'widget_id' , $ widget ) -> exists ( ) ; }
Check if the menu has the given widget.

@param mixed $widget
@return bool
Check if the menu has the given widget .