对多个模型使用相同的范围

How would I create a scope that can be used by multiple models without polluting the global scope space? This scope would be manually called each time I want to use it.

Example:

$assigns = Assign::dryScope();
$contacts = Contact::dryScope();

Best way is to use traits. Use appropriate namespacing as needed. ScopeTrait.php

trait ScopeTrait {
   protected function dryScope() {
    //Scope definition
    }
}


class Assign extends xModel
{
    use ScopeTrait;

}

You can create a class that extends the Model, follows a template below:

class xModel extends Model
{

    protected function dryScope() {}

}


class Assign extends xModel
{

}