Do you know that the legend of the 7 sleepers is mentioned in the Quran ? (Known also as Sleepers of Ephesus /Companions of the Cave)
The sincere believing youth escaped their village and hid in the cave because of their tyrant king So God made them sleep in the cave for 309 years to protect them.
If you are interested to know the Quran narrative of the story then I recommend you read chapter 18 of the Quran.
This is a glimpse of their story from the Quran :
18:17-18
{
And [had you been present], you would see the sun when it rose, inclining away from their cave on the right, and when it set, passing away from them on the left, while they were [laying] within an open space thereof. That was from the signs of Allah. He whom Allah guides is the [rightly] guided, but he whom He leaves astray - never will you find for him a protecting guide.
And you would think them awake, while they were asleep. And We turned them to the right and to the left, while their dog stretched his forelegs at the entrance. If you had looked at them, you would have turned from them in flight and been filled by them with terror.}
If you are interested to know the Quran narrative of the story then I recommend you read chapter 18 of the Quran.
This is a glimpse of their story from the Quran :
18:17-18
{
And [had you been present], you would see the sun when it rose, inclining away from their cave on the right, and when it set, passing away from them on the left, while they were [laying] within an open space thereof. That was from the signs of Allah. He whom Allah guides is the [rightly] guided, but he whom He leaves astray - never will you find for him a protecting guide.
And you would think them awake, while they were asleep. And We turned them to the right and to the left, while their dog stretched his forelegs at the entrance. If you had looked at them, you would have turned from them in flight and been filled by them with terror.}