Phoenix wright CAKE attorney (Or phoenix wrighte cake attorney as it's spelled on fanfiction.net) is the sixth main series fic by jakkid166. It's the first part of Phoenix Wright Turnabout Portal, as a separate fic.
The story opens with Phoenix Wright mourning the death of his cat, Mr. Squipples. After some time, he receives a package in the mail that contains a cake from Pearl, along with a note apologizing for getting him convicted of kidnapping. However, when he takes the cake out, it explodes and knocks him unconscious.
Phoenix wakes up in the hospital with Maya next to him. Maya tells him that Pearl was arrested for attempted murder as a result of the cake. Phoenix took her case and went to investigate his office. Eventually, he and Gumshoe traced the cake back to Manfred von Karma, who was somehow out of prison on parole. However, von Karma escaped them in his car. After a long police chase, von Karma crashes his car and gets flung onto a building, after which he jumps off the building and falls through a conveniently-placed portal.
Phoenix and Gumshoe chase him through the portal, beginning turnabout portal.