A learner driver has avoided jail despite a magistrate describing as "morally reprehensible" his actions in leaving a toddler seriously injured on a road and continuing his trip to Subway.

Zachery Davin Larkins, 22, was handed a 12-month community corrections order after pleading guilty to failing to stop and render assistance to the two-year-old boy who ran on to the road at Laverton in September 2018.

Zachery Larkins leaves court on Wednesday. Credit:AAP

He has also admitted failing to display L-plates, driving unaccompanied and failing to report the crash to police.

"There is no getting away from the fact that the community finds what you did on that evening morally reprehensible," magistrate Jelena Popovic said on Wednesday.