public function scopeIsValidIn($query, $date) { return $query->where('start_date', '<=', $date)->where('end_date', '>=', $date); }