Preheat the oven to 325 degrees.
Poach a 1-inch-thick, 12 oz. cod filet in barely simmering water to cover for 10 to 12 minutes until the tip of a knife or cake tester goes through without resistance. Remove from water and use a fork to flake into ½-inch pieces. You should have 2 cups.
Heat a small (4-quart) cast iron cocotte (Dutch oven) over medium heat and coat the bottom with oil. Add the onions, garlic, bay leaves and a generous pinch of salt. Stir well, then cover and cook, stirring occasionally, until golden brown and very tender, about 10 minutes.
While the onions cook, place the cod in a medium skillet and add enough oil to coat it well. Heat over medium heat, stirring gently, until heated through, about 1 minute. Peel the potatoes and use a mandolin to cut them lengthwise into 1/16-inch slices. Don't rinse them; you want all that starch.
Transfer the onions to a bowl, using a rubber spatula to scrape the cocotte clean. Discard the bay leaves. Coat the bottom of the cocotte with oil and sprinkle salt and pepper over the oil. Cover the bottom of the cocotte with a layer of potatoes, overlapping the slices slightly.
Season with salt, then cover with a thin layer of the onions and a tablespoon of the olives. Now, layer potatoes, salt, pepper, oil, onions, salt, olives and 1 cup flaked cod. Use a spatula to press down hard on the layers. Top with a layer of the egg slices, drizzle with oil, sprinkle with pepper and another layer of potatoes. Press hard again. For the final layering: salt, oil, pepper, the last of the onions, olives, cod and potatoes. Sprinkle with salt and pepper, drizzle with oil, and press down hard with your hand to get it as compact and even as possible.
Cover and bake until the top is lightly browned and the potatoes are tender, 35 to 40 minutes. Spoon out any excess oil, then garnish with the parsley and sliced olives. If you're not serving immediately, run the casserole under the broiler just before serving.