public function scopeApplicable(object $query, array $types): Builder 	{ 		return $query->available()->whereIn('type', $types) 		->where(function ($query) { 			$query->where(function ($query) { 				$query->whereNull('period_from')->whereNull('period_to'); 			})->orWhere(function ($query) { 				$query->whereNull('period_to')->where('period_from', '<', now()); 			})->orWhere(function ($query) { 				$query->where('period_from', '<', now())->where('period_to', '>', now()->subDay()); 			}); 		}); 	}