App\Providers\QueryBuilderServiceProvider::boot PHP Method

boot() public method

public boot ( )
    public function boot()
    {
        Builder::macro('if', function (bool $condition, string $column, string $operator, $value) {
            if ($condition) {
                return $this->where($column, $operator, $value);
            }
            return $this;
        });
    }
QueryBuilderServiceProvider