Exemplo n.º 1
0
 /**
  * Selects discounted prices
  *
  * @param  \October\Rain\Database\Builder   $query
  * @return \October\Rain\Database\Builder
  */
 public function scopeIsDiscounted($query)
 {
     return $query->whereNotNull('discount_id');
 }
Exemplo n.º 2
0
 /**
  * Scope for checking if model is enabled
  * @param  \October\Rain\Database\Builder $query
  * @return \October\Rain\Database\Builder
  */
 public function scopeIsEnabled($query)
 {
     return $query->whereNotNull('is_enabled')->where('is_enabled', true);
 }