— Failure was Nick Foles' only option for what seemed like the longest, darkest time, relieved only by prayer.

You name it, the Philadelphia Eagles' third-year quarterback has already been through it: A wholesale coaching change that led him to re-consider his first intention to attend Arizona State; a second decision to start his college football career at Michigan State that did not work out for a variety of reasons; being surrounded by a poor team as a senior at Arizona, where he took a weekly beating as a pocket passer with limited mobility and very poor protection; a rookie NFL season in which his team won just one of its last 12 games; and finally a failure to win an open audition for the Eagles' starting job in 2013.

Yet Foles enters this training camp, which begins Saturday at the NovaCare Complex, with a Pro Bowl berth on his resume and franchise records for quarterback rating (101.1), completion percentage (62.5) and pass attempts without an interception (237) under his belt.

This, after being drafted in the third round with little fanfare in 2012.

Nick Who?

What was that 40 time again?

All part of a plan Foles strongly hinted might not even be controlled by him as he sat in a roundtable discussion with reporters before the team took its summer break last month.

Certainly he could not have envisioned himself as the 2013 Pro Bowl offensive MVP after losing a competition with Matt Scott for the starting job at Arizona in 2009, which came after transferring from Michigan State the year before.

But it was at Michigan State, some 1,300 miles from his childhood home in Austin, Texas where his career started to point to Philadelphia, by way of Arizona.

"I grew up in a Christian household ... but that was the first year I really opened up the Bible for myself," Foles said. "So my faith started growing and really there was a moment there where I didn't know what to do, what direction to go. I was 18, from Texas, up there, and I just prayed to have God guide me and I had tears in my eyes because I had no clue what to do. I didn't know what to do.

"And at the end of the year, there was a lot of prayer and talked to the family and talked to [Michigan State] coach [Mark] Dantonio and decided it was best to go elsewhere. It was a very tough decision. I mean I don't think I had a horrible year. I developed a lot of great friendships. … but I just knew in my heart that it was the right thing to do."

His football career almost fizzled at Arizona as well, after losing out to Scott. But he did meet Tori Moore, who would become his wife. And he did eventually become the starter.

Yet it would get worse before it would get better.

Though Foles established single-season program records for passing yards (4,334) and TD passes (28) as a senior, the Wildcats won just four games.

That was exactly the number of wins the Eagles had during his rookie season , when Foles started six games and won just one — on a last-second TD pass at Tampa Bay.

Then came a new coaching staff, another open competition and another battle lost, this time to Michael Vick, a folk hero to most players in the league who had developed into a trusted locker room leader in Philadelphia.

Foles picked himself up again when Vick suffered another inevitable injury and proceeded to make some league history.

None of it would have happened, Foles believes, if not for the failed experiment at Michigan State.

"When I went to Arizona, what I went through at Michigan State equipped me to go through the battles I would have upcoming with sitting out a year, going to be the scout team quarterback every single day, going in a quarterback battle my redshirt sophomore year, not winning the quarterback battle, being a backup," Foles said. "And then, all of a sudden, I get an opportunity against Iowa and we go on an 80-yard touchdown drive and I throw it to Juron Criner, who we had a great career as a duo together at Arizona.

"It's just one of those things where if I didn't have Michigan State and went through that, I don't think I would have been able to do what I did at Arizona. And when I say, 'do,' I mean able to handle the situation, every day just not let it get to me, and just keep working, because I knew that one day I would get an opportunity."

Foles is aware that he must prove himself again this season to win the job long term, but at least he's a frontrunner now, after so many years as an overlooked underdog.

"The big thing is everybody says it's luck," Foles said. "Well it's are you prepared for that opportunity when it arises, because some people aren't and then they never get another one. So I knew at that time I would probably get one opportunity [at Arizona] and if I didn't show it, it might not ever happen again.

"I didn't put too much pressure on myself. I just worked hard and studied film, and when the opportunity arose just trusted my gut."

That part won't change now that Foles is on top, according to Eagles coach Chip Kelly.

"What makes Nick really special is that he's never really content with where he is," Kelly said. "I think he understands where he is. Obviously he's a lot more prepared going into Year 2 [in this system], but what he's going to face is probably going to be a little bit different, too. So he's one of those guys that constantly works at things and is always trying to improve, and that's why he's a fun guy to coach."

THE FOLES TIMELINE

A look at Nick Foles' career since leaving Westlake High School in Austin, Texas in 2007.

•2007: Changes mind on oral commitment to Arizona State due to coaching staff being fired and enrolls at Michigan State.

2008: Transfers to Arizona and sits out season

2009: Loses competition to dual-threat Matt Scott for starting job. Given the job at midseason, after Scott struggles, and holds it for the rest of his career with Wildcats.

2011: Finishes season with 387 completions in 560 attempts for 4,334 yards and 28 TDs but wins just four of 12 games.

2012: Drafted in third round by Eagles, wins one game in six starts before being sidelined for final game due to a broken hand.

2013: Loses preseason competition to Michael Vick. Inserted against NY Giants on Oct. 6 and leads Eagles to 36-21 victory. Starts all but one game the rest of the way, being forced to sit out the rematch against the Giants because of a concussion, and leads NFL in QB rating (119.2), yards per attempt (9.1) and TD percentage (8.5) as Eagles win NFC East with 10-6 record. His 27-2 TD/INT ratio goes down as finest in league history. Earns Pro Bowl berth and is offensive MVP of the game.