Peel and finely chop the onion. Trim and peel the carrot, then dice it to match. Trim the dry ends off the celery stick then finely slice it. Put a large pan on a medium heat for 2 mins, then add 1 tsp olive oil and the diced veg. Season with salt and pepper and fry, stirring often, for 8-10 mins till the veg are glossy and starting to soften. If they brown and dry out, turn the heat down and add 1-2 tbsp water.
While the veg fry, peel and grate or crush the garlic, if you’re using it. Finely chop the basil stalks, if you’re using basil, and set the leaves aside for later. Drain the cannellini and borlotti beans and rinse them.
Add the garlic and basil stalks to the veg, along with 1 tbsp Italian herb blend (see our tip below) and cook, stirring, for 2 mins till the pan smells aromatic. Tip in the beans, then tip in the chopped tomatoes. Half fill the tin with water (around 200ml) and add that to the pan. Stir to mix, then cover the pan with a lid and bring to the boil. Once the pan bubbles, turn the heat down and simmer for 20 mins. Stir every now and then till the sauce thickens a little.
While the beans simmer, finely chop the basil leaves. Stir most of the into the breadcrumbs with a pinch of salt and pepper.
Preheat your grill to high. Taste the beans and add a pinch more salt and pepper if you think it needs it. Spoon the beans into an ovenproof dish (or 2 individual dishes) and sprinkle the breadcrumbs over the top. Slide under the grill for 5-6 mins till golden and bubbling.
Cool the bean gratin for a few mins, then serve in bowls garnished with the remaining chopped basil.
Top tip: you can use a mix of dried herbs and spices in this dish if you don’t have an Italian herb blend in your kitchen cupboard. Dried oregano, basil, thyme, rosemary, sage, fennel seeds and dried chilli flakes would all be brilliant. Experiment with a mix and, if you’re just using one or two of the herbs, just use 1-2 tsp instead of the full 1 tbsp.