public function scopeFindEndingTrial($query, $dayRange = 3)
    {
        $from = Carbon::now();
        $to = Carbon::now()->addDays($dayRange);

        $query->whereBetween('trial_ends_at', [$from, $to]);
    }
public function scopeFindEndingTrial($query, $dayRange = 3)
    {
        $from = Carbon::now();
        $to = Carbon::now()->addDays($dayRange);

        $query->whereBetween('trial_ends_at', [$from, $to]);
    }
public function scopeFindEndingTrial ( $ query , $ dayRange = 3 ) { $ from = Carbon :: now ( ) ; $ to = Carbon :: now ( ) -> addDays ( $ dayRange ) ; $ query -> whereBetween ( 'trial_ends_at' , [ $ from , $ to ] ) ; }
Find subscription with an ending trial.

@return \Illuminate\Database\Eloquent\Builder
Find subscription with an ending trial .