Exemplo n.º 1
0
 /**
  * Add a relationship count condition to the query with where clauses.
  *
  * @param string $relation
  * @param \Closure|null $callback
  * @return \Illuminate\Database\Eloquent\Builder|static 
  * @static 
  */
 public static function whereDoesntHave($relation, $callback = null)
 {
     //Method inherited from \Illuminate\Database\Eloquent\Builder
     return \October\Rain\Database\Builder::whereDoesntHave($relation, $callback);
 }
Exemplo n.º 2
0
 /**
  * Returns products that do not have inventories in stock
  *
  * @param  \October\Rain\Database\Builder   $query
  * @return \October\Rain\Database\Builder
  */
 public function scopeOutOfStock($query)
 {
     return $query->whereDoesntHave('inventories', function ($inventory) {
         $inventory->where('quantity', '>', 0);
     });
 }