app/Services/CalendarService.php
private function adarIIAnniversaries(Builder $query, JewishDate $anniv): void
    {
        if ($anniv->day() === 1) {
            $query->where('d_day', '<=', 1);
        } elseif ($anniv->day() === $anniv->daysInMonth()) {
            $query->where('d_day', '>=', $anniv->daysInMonth());
        } else {
            $query->where('d_day', '<=', 1);
        }

        $query->where(static function (Builder $query): void {
            $query
                ->where('d_mon', '=', 7)
                ->orWhere(static function (Builder $query): void {
                    $query
                        ->where('d_mon', '=', 6)
                        ->where(DB::raw('(7 * d_year + 1 % 19)'), '>=', 7);
                });
        });
    }
private function adarIIAnniversaries(Builder $query, JewishDate $anniv): void
    {
        if ($anniv->day() === 1) {
            $query->where('d_day', '<=', 1);
        } elseif ($anniv->day() === $anniv->daysInMonth()) {
            $query->where('d_day', '>=', $anniv->daysInMonth());
        } else {
            $query->where('d_day', '<=', 1);
        }

        $query->where(static function (Builder $query): void {
            $query
                ->where('d_mon', '=', 7)
                ->orWhere(static function (Builder $query): void {
                    $query
                        ->where('d_mon', '=', 6)
                        ->where(DB::raw('(7 * d_year + 1 % 19)'), '>=', 7);
                });
        });
    }
private function adarIIAnniversaries ( Builder $ query , JewishDate $ anniv ) : void { if ( $ anniv -> day ( ) === 1 ) { $ query -> where ( 'd_day' , '<=' , 1 ) ; } elseif ( $ anniv -> day ( ) === $ anniv -> daysInMonth ( ) ) { $ query -> where ( 'd_day' , '>=' , $ anniv -> daysInMonth ( ) ) ; } else { $ query -> where ( 'd_day' , '<=' , 1 ) ; } $ query -> where ( static function ( Builder $ query ) : void { $ query -> where ( 'd_mon' , '=' , 7 ) -> orWhere ( static function ( Builder $ query ) : void { $ query -> where ( 'd_mon' , '=' , 6 ) -> where ( DB :: raw ( '(7 * d_year + 1 % 19)' ) , '>=' , 7 ) ; } ) ; } ) ; }
ADS includes non-leap ADR.

@param Builder    $query
@param JewishDate $anniv
ADS includes non - leap ADR .