app/Filters/BaseFilter.php
public function keys($values)
    {
        $keys = explode(',', $values);
        $model = $this->builder->getModel();
        $validator = validator([ 'values' => $keys ], [ 'values.*' => 'exists:'.$model->getTable().','.$model->getKeyName() ]);
        return $this->builder->when(!$validator->fails(), function (Builder $query) use($keys) {
            $query->whereKey($keys);
        });
    }
public function keys($values)
    {
        $keys = explode(',', $values);
        $model = $this->builder->getModel();
        $validator = validator([ 'values' => $keys ], [ 'values.*' => 'exists:'.$model->getTable().','.$model->getKeyName() ]);
        return $this->builder->when(!$validator->fails(), function (Builder $query) use($keys) {
            $query->whereKey($keys);
        });
    }
public function keys ( $ values ) { $ keys = explode ( ',' , $ values ) ; $ model = $ this -> builder -> getModel ( ) ; $ validator = validator ( [ 'values' => $ keys ] , [ 'values.*' => 'exists:' . $ model -> getTable ( ) . ',' . $ model -> getKeyName ( ) ] ) ; return $ this -> builder -> when ( ! $ validator -> fails ( ) , function ( Builder $ query ) use ( $ keys ) { $ query -> whereKey ( $ keys ) ; } ) ; }
Get collection of resources by keys
@param  string $values
@return \Illuminate\Database\Eloquent\Builder
Get collection of resources by keys