public function scopeWithoutWidgets(Builder $query, $widgets, string $column = 'id'): Builder
    {
        $widgets = static::isWidgetsStringBased($widgets)
            ? $widgets : static::hydrateWidgets($widgets)->pluck($column);

        return $query->whereDoesntHave('widgets', function (Builder $query) use ($widgets, $column) {
            $query->whereIn($column, (array) $widgets);
        });
    }
public function scopeWithoutWidgets(Builder $query, $widgets, string $column = 'id'): Builder
    {
        $widgets = static::isWidgetsStringBased($widgets)
            ? $widgets : static::hydrateWidgets($widgets)->pluck($column);

        return $query->whereDoesntHave('widgets', function (Builder $query) use ($widgets, $column) {
            $query->whereIn($column, (array) $widgets);
        });
    }
public function scopeWithoutWidgets ( Builder $ query , $ widgets , string $ column = 'id' ) : Builder { $ widgets = static :: isWidgetsStringBased ( $ widgets ) ? $ widgets : static :: hydrateWidgets ( $ widgets ) -> pluck ( $ column ) ; return $ query -> whereDoesntHave ( 'widgets' , function ( Builder $ query ) use ( $ widgets , $ column ) { $ query -> whereIn ( $ column , ( array ) $ widgets ) ; } ) ; }
Scope query without the given widgets.

@param \Illuminate\Database\Eloquent\Builder $query
@param int|string|array|\ArrayAccess|WidgetModelContract $widgets
@param string $column

@return \Illuminate\Database\Eloquent\Builder
Scope query without the given widgets .