What should be done with an item bearing the name of Allah before entering the lavatory?
Chapter on Cleaning oneself (Istitabah) and Impurity (Hadath)
Al-Mughni
Book of Purification
Primary text
If one enters the lavatory carrying something bearing the name of Allah, it is recommended to set it aside. The practice of the Prophet (peace be upon him) placing his signet ring aside is narrated. If one ensures the item's safety or turns the ring's bezel inward, it is permissible. Ahmad stated that if the ring bears the name of Allah, it should be placed on the inside of the palm and then one may enter.
Supporting text
Ibn Al-Musayyib, Al-Hasan, and Ibn Sirin permitted carrying it with precautions. Ahmad expressed hope that carrying money, which has the name of Allah on it, is not a problem.