protected function hydrateWidgets($widgets)
    {
        $isWidgetsStringBased = static::isWidgetsStringBased($widgets);
        $isWidgetsIntBased = static::isWidgetsIntBased($widgets);
        $field = $isWidgetsStringBased ? 'id' : 'id';
        $className = static::getWidgetClassName();

        return $isWidgetsStringBased || $isWidgetsIntBased
            ? $className::query()->whereIn($field, (array) $widgets)->get() : collect($widgets);
    }
protected function hydrateWidgets($widgets)
    {
        $isWidgetsStringBased = static::isWidgetsStringBased($widgets);
        $isWidgetsIntBased = static::isWidgetsIntBased($widgets);
        $field = $isWidgetsStringBased ? 'id' : 'id';
        $className = static::getWidgetClassName();

        return $isWidgetsStringBased || $isWidgetsIntBased
            ? $className::query()->whereIn($field, (array) $widgets)->get() : collect($widgets);
    }
protected function hydrateWidgets ( $ widgets ) { $ isWidgetsStringBased = static :: isWidgetsStringBased ( $ widgets ) ; $ isWidgetsIntBased = static :: isWidgetsIntBased ( $ widgets ) ; $ field = $ isWidgetsStringBased ? 'id' : 'id' ; $ className = static :: getWidgetClassName ( ) ; return $ isWidgetsStringBased || $ isWidgetsIntBased ? $ className :: query ( ) -> whereIn ( $ field , ( array ) $ widgets ) -> get ( ) : collect ( $ widgets ) ; }
Hydrate widgets.

@param int|string|array|\ArrayAccess|WidgetModelContract $widgets

@return \Illuminate\Support\Collection
Hydrate widgets .