Control/vary LM317 output voltage with PWM

Anyone got a good schematic to control/adjust an LM317 via PWM (Arduino pin 9). I want to be able to give 50% to 100% duty cycle and output 5VDC to 12VDC or so. Supply to LM317 will be 12VDC

I have no idea why you want to use an LM317, this will do the job nicely:-

Well... I wanted to try regular linear voltage control. I have a few different applications that I thought a variable LM317 would be great for. Like #1 the fan control. and #2 output 1 to 10VDC (controlled from PWM signal) for a LED Meanwell ELN-60-48D ballast dimmer circuit.
Guess I will just go with your schematic for the fan control and use a filter/op amp for my 0-10VDC dimmer control circuit.

Still would like to see if anyone has a decent schematic though.

I'm assuming I can use this Mosfet instead of the surface mount version you have in that schematic. Right??

Yeah, you might have better luck driving a LEGACY LM723 that way though...