public function scopeFree($query) { if (!config('app.offering_free_products')) { $query->where('type', '<>', 'freeproduct'); } }