It wasn't all that long ago that investors and analysts alike were predicting a "retail apocalypse."

The term was widely used in 2016 and 2017 as it became clear that the e-commerce threat from Amazon.com (AMZN - Get Report) and other disruptive digital retailers was dramatically altering the retail landscape. Brick-and-mortar retailers were quickly facing high hurdles in the form of operating expenses that the digital competition didn't have to deal with.

And as two-day and even same-day shipping became normalized in the industry, the convenience factor swayed heavily in favor of e-commerce players. Former giants in the retail industry have seen their market share shrink dramatically, with tens of thousands of physical retail locations having closed in recent years and tens of thousands more still at risk.

However, in recent quarters some traditional retail powerhouses have proven that they can adapt and compete. Home Depot (HD - Get Report) , Lowes (LOW - Get Report) , Target (TGT - Get Report) , and Walmart (WMT - Get Report) have all posted impressive second-quarter earnings reports, proving that it's not all doom and gloom in this space. Let's look at each in turn.

1. Walmart 

On Aug. 15, Walmart gave a much-needed boost to the Dow Jones Industrial Average, which had been struggling, with its Q2 report and ensuing 6%+ pop. Walmart posted a beat on the top and bottom-lines. Its EPS growth was actually down slightly year-over-year, but analysts were impressed with the company's increased forward-looking profit guidance. Walmart's same store sales were up 2.8%, bolstered by higher average transaction sizes. Walmart also posted strong digital sales growth with its e-commerce segment generating 37% year-over-year growth.

2. Home Depot 

Home Depot followed up Walmart's performance on Aug. 20, posting a bottom-line beat and a slight top-line miss. Home Depot's earnings were up 4% year-over year and its revenues rose 1.2%. Home Depot's U.S. same store sales rose 3.1% with transactions flat and average ticket size up 1.7%. The company's online sales increased 20% during Q2, proving that this is yet another brick-and-mortar name capable of competing in the digital landscape.

Other than the online sales, these growth figures aren't great. But they are impressive considering the weight that the trade war and the Chinese tariffs are putting on the retail industry. In the face of these tariffs, Home Depot lowered its full year sales and earnings estimates, but management still expects to see low single digit percentage growth on both the top and bottom-line.

Overall, Home Depot's quarter wasn't stellar by any means, but the company's slow and steady growth in the face of various headwinds was enough to remove some jitters from the market and push its stock up to 52-week highs. 

3. Lowe's

Home Depot's major rival in the home improvement space, Lowe's, posted earnings the very next day with a top and bottom-line beat. Lowe's sales and EPS were up 0.5% and 27.4%, respectively on a year-over-year basis. The company's same store sales were up 2.3% during the quarter, with the U.S home improvement segment posting 32% comparable growth. The company posted full year guidance during its Q2 report calling for low single digit sales growth and high single digit EPS growth.

Lowe's shares dipped in late May after a disappointing Q1 report, but these Q2 numbers combined with the full-year guidance have sparked a rally in the name. Lowe's isn't trading at 52-week highs like Walmart and Home Depot, but it is climbing, and is now up nearly 20% from the lows it posted a few months ago.

4. Target

Target put the icing on the cake of the big box retail rally that we've seen during the last two weeks, releasing its Q2 numbers which included a huge $0.21 beat on the bottom-line with GAAP earnings-per-share of $1.82. This $1.82 figure represents 22% year-over-year growth. Target beat analyst expectations on the top-line as well, posting year-over-year revenue growth of 5%.

Same store sales at Target increased 3.4%, well above analyst expectations 3%. Total transactions were up 2.4% and the average size of this transitions was up 0.9%. And, Target's digital sales were up 34% year-over-year, showing that the company's multi-tiered approach to retail is working.

Providing A Much-Needed Boost 

These big box retail earnings came at a fortuitous time. Prior to Walmart's results, the market had been digesting the disappointing department store results coming from Macy's ( M - Get Report) (which lowered its profit guidance for the full year) and J.C. Penney ( JCP - Get Report) (which is at risk of being de-listed from the New York Stock Exchange due to poor share price performance), which obviously didn't bode well for the retail space.

The recent retail rally has also helped to stave off fears of recession. The strong performance by the blue chip retail names shows that the U.S. consumer remains strong. These companies continue to cite tariffs as a potential headwind, and this will remain an issue in the short-term until the trade war is resolved.

Longer-term, all physical retail names are forced to deal with the elephant in the room that is Amazon. However, with Amazon making a push into the brick-and-mortar space, it appears that the omni-channel approach adopted by many of the big box names may well prove to be the most successful way to meet consumer demands. 

The rally that we've seen in the big box retailers has pushed their share prices up towards the highs. Their valuations are rising right along the share prices and these names are no longer the values they were a couple of years ago. But rising confidence and steady growth should result in increased valuation premiums.

It's undeniable that the retail industry has been facing dramatic changes and there are many retailers whose fates are still uncertain. However, when looking at the data, I think it's safe to say that the four traditional retail names discussed above have not only survived Amazon's onslaught, but proven they can thrive.

The changing retail environment has forced them to evolve and now they're stronger for it. Once again, I believe that these are the types of names that can be viewed as defensive names, especially in income oriented/dividend growth portfolios.

Save 57% With Our Labor Day Sale. Join Jim Cramer's Action Alerts PLUS investment club to become a smarter investor! Click here to sign up!

Amazon and Home Depot are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells these stocks? Learn more now.

Nicholas Ward is long HD and AMZN.