I do a liquid soap that costs about 50 cents to a dollar per gallon depending on what type of soap you use.
First, grate a bar of soap and put that and 4 cups of hot water in a saucepan over medium-low heat and stir until the soap dissolves completely.
Next, fill a 5-gallon bucket about half full of hot water, then add your melted soap, 1 cup of borax and 1/2 cup of washing soda. Stir until everything is dissolved. Fill the bucket the rest of the way with hot water. cover over night so that the mixture thickens
then take empty and clean laundry detergent bottles and fill half with soap and half with water. you can keep your base in the 5 gallon bucket if you only have a few laundry detergent bottles, just make sure you stir the base before pouring into the bottle.
For each load you use 5/8 of a cup if you have a top loading washer (180 loads) and 1/4 of a cup if you have a front loading washer (640 loads) You can also add 10 drops of essential oil per 2 gallons, but your soap should be fragrant enough.