Every time the app is idle and then I make a post or get request for some query then it take 5-6 second but after that connection it will be normal. What causing this? Is the server going into a sleep mode?
This can be related to caching on either your server or in your application. The first time your run your application Laravel will try to find all php classes and put the reference of them in one file. After that it will reference that cache file which is much faster than looking up each class all the time.
It can also be related to OPcaching or any other kind of caching. Also the hosting way depends. Do you use shared hosting? Or anything else?