Donald Trump should have realized that his presidential clout was weakening when a GoFundMe account became the leading source of funds for his long-desired “big, beautiful wall.”

The social media effort, started by an Iraq war veteran, generated more than $12 million within a few days, an impressive sum. But that’s nowhere near the $5 billion Trump covets.

And although the House of Representatives passed a bill late Thursday appropriating the amount Trump requested, as this column went to press it seemed doubtful the Senate would follow suit. The only question was whether Senate Democrats would consent to any funding in exchange for averting a government shutdown.

A physical barrier across the entire nearly 2,000 mile U.S.-Mexico border was never a realistic goal. The president can tweet his disdain all he wants. Mexico is not paying for the wall. Our military isn’t building it. And it was never the best solution in the first place.

A lot has changed in the last few weeks, and more complicating factors for this president’s view of migration loom. That’s good news for Americans who care about ensuring border security and who also want a decent and effective approach to managing the humanitarian crisis of thousands of migrants, including seeing to the welfare of the more than 14,000 immigrant children in shelters across the United States.

Trump does have something he could crow about, having gained tentative cooperation from the new president of Mexico. Andres Manuel López Obrador assumed the presidency in December, and he appears willing to go along with accepting Central American migrants while they await their appeals for asylum in U.S. immigration courts.

That tenuous arrangement could also allow Trump to gracefully retreat from, rather than fight, court rulings that defeated his efforts to upend U.S. asylum law. Former Attorney General Jeff Sessions declared that those fleeing domestic violence and murderous gangs would no longer be considered for those reasons. A federal judge decided otherwise.

If we’re going to spend money to solve the problem of crowds at the border, let’s increase funding for immigration judges. It would advance both Mexico’s interests and our own.

Physical barriers can be effective in regions where population centers are dense on both sides, but not without consequences. Consider San Diego.

Migrant deaths in Arizona spiked in the past after fencing in California shoved migrant crossings to more dangerous and remote regions.

Similar circumstances were at play in early December, when 7-year-old Jakelin Caal Maquin arrived with her father at the border in New Mexico. It’s not a state that historically has seen many migrants cross. That night, the four border agents were overwhelmed with more than 160 Guatemalans, and they clearly were not equipped to handle her medical emergency. Jakelin died.

Funding for more immigration judges to cut down on backlogs could help process the people as they seek legal entry. It could also free agents and other resources to deal with other problems, such as drug smuggling.

Trump would do well to speak more about China as the source of fentanyl, a leading cause of the more than 72,000 drug overdose deaths the U.S. saw in 2017. He could continue to press China to follow through with its agreement to sanction the drug’s production.

The New Year brings a chance to refocus, to shift from attitudes and approaches that have not served us well.

And for Christmas, maybe Melania Trump could do us all a favor and slip a special present under the tree for her husband: a LEGO set. Then the president could gleefully construct his beautiful wall.