public static function filterByScope($filter)
    {
        $operator = Arr::get($filter, 'operator');
        $method = Arr::get($filter, 'method');
        $source = Arr::get($filter, 'settings.source');
        $arguments = Arr::get($filter, 'arguments');
        $value_one = Arr::get($filter, 'value_one');
        $value_two = Arr::get($filter, 'value_two');
        $settings = Arr::get($filter, 'settings');
        $positive = Arr::get($filter, 'positive');

        if (Arr::has($filter, 'settings.source')) {
            $model = Arr::get($filter, 'settings.model');

            $method_transform = 'transform'.Str::studly($source).'Value';

            if (method_exists($model, $method_transform)) {
                $value_one = $model->$method_transform($value_one);
            }

            $method_lookup = 'scope'.Str::studly($source);

            if (!method_exists($model, $method_lookup)) {
                return false;
            }

            $method = Str::camel($source);
            $arguments = [$value_one];
        }

        return [
            'operator'  => $operator,
            'method'    => $method,
            'arguments' => $arguments,
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => $positive,
        ];
    }
public static function filterByScope($filter)
    {
        $operator = Arr::get($filter, 'operator');
        $method = Arr::get($filter, 'method');
        $source = Arr::get($filter, 'settings.source');
        $arguments = Arr::get($filter, 'arguments');
        $value_one = Arr::get($filter, 'value_one');
        $value_two = Arr::get($filter, 'value_two');
        $settings = Arr::get($filter, 'settings');
        $positive = Arr::get($filter, 'positive');

        if (Arr::has($filter, 'settings.source')) {
            $model = Arr::get($filter, 'settings.model');

            $method_transform = 'transform'.Str::studly($source).'Value';

            if (method_exists($model, $method_transform)) {
                $value_one = $model->$method_transform($value_one);
            }

            $method_lookup = 'scope'.Str::studly($source);

            if (!method_exists($model, $method_lookup)) {
                return false;
            }

            $method = Str::camel($source);
            $arguments = [$value_one];
        }

        return [
            'operator'  => $operator,
            'method'    => $method,
            'arguments' => $arguments,
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => $positive,
        ];
    }
public static function filterByScope ( $ filter ) { $ operator = Arr :: get ( $ filter , 'operator' ) ; $ method = Arr :: get ( $ filter , 'method' ) ; $ source = Arr :: get ( $ filter , 'settings.source' ) ; $ arguments = Arr :: get ( $ filter , 'arguments' ) ; $ value_one = Arr :: get ( $ filter , 'value_one' ) ; $ value_two = Arr :: get ( $ filter , 'value_two' ) ; $ settings = Arr :: get ( $ filter , 'settings' ) ; $ positive = Arr :: get ( $ filter , 'positive' ) ; if ( Arr :: has ( $ filter , 'settings.source' ) ) { $ model = Arr :: get ( $ filter , 'settings.model' ) ; $ method_transform = 'transform' . Str :: studly ( $ source ) . 'Value' ; if ( method_exists ( $ model , $ method_transform ) ) { $ value_one = $ model -> $ method_transform ( $ value_one ) ; } $ method_lookup = 'scope' . Str :: studly ( $ source ) ; if ( ! method_exists ( $ model , $ method_lookup ) ) { return false ; } $ method = Str :: camel ( $ source ) ; $ arguments = [ $ value_one ] ; } return [ 'operator' => $ operator , 'method' => $ method , 'arguments' => $ arguments , 'value_one' => $ value_one , 'value_two' => $ value_two , 'settings' => $ settings , 'positive' => $ positive , ] ; }
Filter by scope.

@return void

@SuppressWarnings(PHPMD.UnusedLocalVariable)
@SuppressWarnings(PHPMD.CyclomaticComplexity)
Filter by scope .