src/Models/Vacancy.php
public function scopeUntil($query, $until = null)
    {
        if (!$until) {
            return $query;
        }

        return $query->where('date', '<', $until->toDateTimeString());
    }
public function scopeUntil($query, $until = null)
    {
        if (!$until) {
            return $query;
        }

        return $query->where('date', '<', $until->toDateTimeString());
    }
public function scopeUntil ( $ query , $ until = null ) { if ( ! $ until ) { return $ query ; } return $ query -> where ( 'date' , '<' , $ until -> toDateTimeString ( ) ) ; }
Scope Until.

@param Illuminate\Database\Query $query
@param \Carbon\Carbon $until

@return Illuminate\Database\Query Scoped query
Scope Until .