getMacro() public method

Get the given macro by name.
public getMacro ( string $name ) : Closure
$name string
return Closure
Exemplo n.º 1
0
 /**
  * Get the given macro by name.
  *
  * @param string $name
  * @return \Closure 
  * @static 
  */
 public static function getMacro($name)
 {
     return \Illuminate\Database\Eloquent\Builder::getMacro($name);
 }
Exemplo n.º 2
0
 /**
  * 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;
 }