It looks like they just laid a piece of fondant over the cake and trimmed all the way around. I just use scissors and cut the desired length then I take a ruler and gently press under the edge of the fondant to make a smooth line. If you can find a square box in the correct size you can place the fondant over the top trim and let dry but then the lid would be hard. Either way would work.
If you want it perfectly square you can mold the fondant over the outside of the square cake pan you are using to bake the cake. It should fit right over the cake if your fondant on your cake is not too thick. I hope this makes sense.
Love won't meet our expections...it's mystery is pure and absolute.
Cut a piece of fondant for the top of the cake and also some side panels. Let them dry for a couple of days...add tylose to fondant or use gumpaste. Trim the pieces according to the size of the cake. I use melted chocolate to adhere the pieces and have filled the gaps with either royal icing or with shortening...works very well. I learned this from sugarshacks video "boxes and bows".