/** * Get the given macro by name. * * @param string $name * @return \Closure * @static */ public static function getMacro($name) { return \Illuminate\Database\Eloquent\Builder::getMacro($name); }
/** * Return trashed models with query if told so * * @param \Illuminate\Database\Eloquent\Builder $query * @return \Illuminate\Database\Eloquent\Builder */ protected function useWithTrashed(Builder $query) { if ($this->withTrashed && $query->getMacro('withTrashed') !== null) { return $query->withTrashed(); } return $query; }