I have a 2006 corola. It sometimes just quits while driving it. I pull over and shut the key off for a couple of minutes then restart and is ok for awile. The check engine light also comes on when this happens. This will reset itself sometimes after a few starts.
I have a 2005 Corolla which seems to be doing the same kind of thing that you car did. The ECM? Computer was still under warranty on my car. Toyota states that have put that computer under warranty for 8 years or 80,000 miles which ever comes first. Toyota replaced the computer at no charge to me and even paid for the towing cost. After I got my car back it worked ok for a couple of days but then the same problem happened again. I just took my car back in and they changed the front Oxgen sensor and it seems to be running ok. I hope this helps in some small way. Smiles!
Let's try the simple first and replace the fuel filter soon as we can, The fuel filter may be at the end of it's life and is causing the engine to quit working when the flow of fuel is restricted. Note the fuel pump is working harder trying to keep the fuel pressure up and may over heat causing it to fail also which mean a costly replacement of the fuel pump in the gas tank. Good luck and keep me posted, be glad to help.