I just used larage forge and installed letsencrypt ssl and it works perfectly fine on non www domain.
but when i sed www.domain.com it redirects to domain.com only
My goal here is if a visitor enters domain.com it should go to www.domain.com
Right now, without the www it works perfect. but when you entered www.domain.com it doesnt.
Please help.
Any help is highly appreciated.
It looks like you haven't set up the www CNAME redirect.
This is the reason it isn't working as LetsEncrypt tries to access www.yourdomain.com but can't (as you haven't set up the DNS correctly).
How are you managing your DNS? It may be directly with the company where you bought your domain name from or it might be through your hosting provider, or even another company altogether. In any case, you should find where your DNS is managed, and add a CNAME record: WWW should go in the name field, and your domain name (without the www) along with a period at the end, should go in the hostname field. Like so: