Gastroretentive drug delivery systems can deliver narrow-window drugs to the upper stomach at a controlled rate. The raft forming process is better than floating structures, liquid dosing mediums, and in situ gelation for sustained drug release in the upper GI tract. According to statistics, lafutidine is exactly put in the parietal cells of the stomach mucosa, where the upper gastro-intestinal tract absorbs it. Lafutidine capsules had 65–70% bioavailability compared to intravenous infusion. Stability and absorption are acceptable between 1 and 4. The colon and lower gastrointestinal tract degenerate. In this study, the formulations were changed into gel for simulated gastric fluid (pH 1.2) and floated in the gastrointestinal environment, releasing medication for 12 hours. The finished device was tested. UV was linear from 5–30 g/ml with a regression value of 0.999. IR and DSC demonstrated negligible interaction between chemical, polymers, and excipients. Gelling polymers and calcium chloride were complexed with two xyloglucan polymers, gellan gum, and in situ gelling formulations. Xyloglucan was the best polymer for rheological tests, medication content, mucoadhesive strength, and gel strength. Lafutidine's solution formulae X10 and G10 did not improve in appearance, drug content, or dissolving profile after three months at 40°C and 75% RH. Wistar rats tested the in situ optimized Lafutidine gelling (X10, G10) formula. The ulcer index, stomach acid volume (ml), acidity (mEq / l / g), and pH were significantly affected by a single-way ANOVA solution and Tucky's multiples comparison test. The current work successfully developed, tested, and produced an oral continuous release floating Lafutidine gelling device with stomach-specific drug delivery, maintaining drug release and gastric preservation for the required time.