// in your model
public function scopeField($query)
{
return $query->where('field', 'value'); // if in header return $query->where('field', request()->field);
}
// in your controller or repository
public function index()
{
return Package::field()->get();
}