وَأُعْرِبَ مَا بَعْدَ «إِلَّا» بِحَسَبِ الْعَوَامِلِ
The term following illā takes the case required by its grammatical governor.
ConstructionFunction after illā
مَا جَاءَ إِلَّا زَيْدٌZayd: nominative subject
مَا ضَرَبْتُ إِلَّا زَيْدًاZayd: accusative object
مَا جَاءَ إِلَّا رَاكِبًاRākiban: accusative circumstantial qualifier
مَا سَارَتْ إِلَّا يَوْمَ الْجُمُعَةِYawm: accusative time adverbial
Exhaustive exception conveys restriction; it does not force all items after illā into a single fixed grammatical case.