Assalamualaikum w.b.t. What is the ruling of sleeping after Subuh? What is the ruling of it for people who work night shifts and whose shift only ends after Subuh? Hope for an explanation.
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
The blessings in the morning
The morning time is filled with blessings and goodness. There are specific supplications taught by the Prophet PBUH in the morning when the time is filled with blessings. From Sakhr al-Ghamidi, the Prophet PBUH said:
اللَّهُمَّ بَارِكْ لأُمَّتِى فِى بُكُورِهَا
“O Allah, bless my nation in their early mornings (i.e., what they do early in the morning).” 
Ibn Battal said: This hadith doesn’t mean that times other than in the morning aren’t blessed. Something that is performed by the Prophet PBUH (at certain times) is a blessed time and the Prophet PBUH is the best uswah (lesson and example) for his ummah. The Prophet PBUH specifies the morning time by supplicating blessings during this time compared to other times because the morning is the time when people are starting their activities. Hence, the Prophet PBUH specified supplication during this time so that his ummah as a whole will attain the blessings in it. 
The encouragement of enlivening the time after Subuh and its advantages
Rasullullah PBUH encourages his ummah when they have completed their Subuh congregational prayers to sit and recite dhikr to Allah SWT until the sun rises, then perform a two rakaat sunnah prayer. Rasullullah PBUH stated the great rewards for those who perform the worship. Prophet PBUH said:
مَنْ صَلَّى الْغَدَاةَ فِى جَمَاعَةٍ ثُمَّ قَعَدَ يَذْكُرُ اللَّهَ حَتَّى تَطْلُعَ الشَّمْسُ ثُمَّ صَلَّى رَكْعَتَيْنِ كَانَتْ لَهُ كَأَجْرِ حَجَّةٍ وَعُمْرَةٍ تَامَّةٍ تَامَّةٍ تَامَّةٍ
“If anyone, prays the dawn prayer in a company, then sits making mention of God till the sun rises, then prays two rak’as, he will have a reward equivalent to that for a hajja* and an ‘umra.” He reported God’s Messenger as adding, “A perfect one, a perfect one, a perfect one.” 
Ibnu ‘Abbas named the prayer Dhuha prayer which is performed in the early morning and is named as Isyraq prayer. It is named as such because it is performed after syuruk time which is when the sun rises. However, although Isyraq prayer is performed during Dhuha prayer, there are several differences between Isyraq and Dhuha prayers. 
In a narration from Jabir bin Samurah, he said:
كَثِيرًا كَانَ لاَ يَقُومُ مِنْ مُصَلاَّهُ الَّذِى يُصَلِّى فِيهِ الصُّبْحَ أَوِ الْغَدَاةَ حَتَّى تَطْلُعَ الشَّمْسُ فَإِذَا طَلَعَتِ الشَّمْسُ قَامَ
“He (the Holy Prophet) used to sit at the place where he observed the morning or dawn prayer till the sun rose or when it had risen;” 
Imam al-Nawawi said: “In this hadith, there is an encouragement of reciting dhikr after Subuh and continue to sit at the place after performing prayer if one doesn’t have any excuses (or matters that prevent him from doing so).” Al-Qadhi said that it is the normal sunnah performed by the salaf and scholars. They will usually fill this time to recite dhikr and supplication until the sun rises. 
The ruling of sleeping after Subuh
There are no clear evidences that prevent a person from sleeping after Subuh. Thus, the ruling of sleeping after Subuh remains to be permissible for there is no evidence that prevents it.
Although there is no evidences that prevents sleeping after Subuh, however, there is numerous encouragements to enliven the time after Subuh. In a hadith, the Prophet PBUH said:
اللَّهُمَّ بَارِكْ لِأُمَّتِي فِي بُكُورِهَا وَكَانَ إِذَا بَعَثَ سَرِيَّةً أَوْ جَيْشًا بَعَثَهُمْ فِي أَوَّلِ النَّهَارِ . وَكَانَ صَخْرٌ رَجُلاً تَاجِرًا وَكَانَ يَبْعَثُ تِجَارَتَهُ مِنْ أَوَّلِ النَّهَارِ فَأَثْرَى وَكَثُرَ مَالُهُ.
“O Allah, bless my people in their early mornings.” When he sent out a detachment or an army, he sent them at the beginning of the day. Sakhr was a merchant, and he would send off his merchandise at the beginning of the day; and he became rich and had much wealth.” 
In another hadith, it is narrated that the Prophet PBUH enlivened the morning after Subuh by sitting and reciting dhikr until the sun rises. This matter can be seen in a hadith from Jabir bin Samurah RA as explained above, he said:
كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا صَلَّى الفَجْرَ قَعَدَ فِي مُصَلَّاهُ حَتَّى تَطْلُعَ الشَّمْسُ
“When the Prophet prayed Fajr he would remain seated where he had prayed until the sun had risen.” 
Likewise, in a hadith from Anas bin Malik RA – who we also cited above – Rasullullah PBUH said”
مَنْ صَلَّى الغَدَاةَ فِي جَمَاعَةٍ ثُمَّ قَعَدَ يَذْكُرُ اللَّهَ حَتَّى تَطْلُعَ الشَّمْسُ، ثُمَّ صَلَّى رَكْعَتَيْنِ كَانَتْ لَهُ كَأَجْرِ حَجَّةٍ وَعُمْرَةٍ
“Whoever prays Fajr in congregation, then sits remembering Allah until the sun has risen, then he prays two Rak’ah, then for him is the reward like that of a Hajj and Umrah.” 
It is clear in the above hadiths, the prophet PBUH greatly emphasizes the importance of management of time, especially in the early mornings for a Muslim. This is seen in the actions encouraged by Rasullullah PBUH in terms of reciting dhikr or going out to work to provide sustenance and due to this, scholars are careful to take care of their time after Subuh so that it is filled with beneficial matters that will be rewarded by Allah SWT.
Al-Hafiz Ibn Hajar al-‘Asqalani stated in his book Fath al-Bari, where it is recorded that sustenance is divided and distributed after Subuh and deeds are lifted or brought to the heavens at the end of the day. For whoever who are in worship during these times, then he is blessed in terms of his sustenance and deeds. 
Ibn Qayyim al-Jauziyyah in his book Zad al-Ma’ad said that sleeping after Subuh hinders one’s sustenance for it is the time for every living creature to ask for sustenance and it is the time when the sustenance is distributed and sleeping during this time is restricted except when there is unavoidable circumstances or exigent situations.  We are also informed that Buya Hamka also sometimes sleep after Subuh.
According to our research, hadiths which mentioned the restriction and constraints of sleeping after Subuh isn’t free from criticisms, whether their status is too weak or fake.
We found that there is no clear prohibition regarding the prohibition of sleeping after Subuh. Thus, there is no restriction against those who want to sleep after Subhuh, however, it is best to avoid it according to the hadiths that show the advantages of enlivening the time after Subuh.
It was once asked Imam Malik regarding sleeping after Subuh prayer, then al-Imam Malik answered: “I don’t know of its prohibition. It is stated that the earth emits a loud sound when scholars sleep during dhuha time in fear that they are negligent during this time.” 
Hence, it is not an offence for those who work the night shift and have to sleep during the day after Subuh for it is a part of their job to work during the night and rest in the morning so that they can perform and fulfil their duties on the next night.
 Narrated by Abu Daud (2606), al-Tirmizi (1212), Ahmad (15481) and al-Nasa’ie in al-Sunan al-Kubra (8833)
 See Syarh Sahih al-Bukhari li Ibn Battal, 9/163
 Narrated by al-Tirmizi al-Tirmizi (586). According to him hadith is hasan gharib.
 See Bughyat al-Muthatawwi’ fi Solaat al-Tathawwu’, hlm. 58-59
 Narrated by Muslim (670)
 See Syarh al-Nawawi ‘ala Sahih Muslim, 8/29
 Narrated by Abu Daud (2606)
 Narrated by al-Tirmizi (585). Menurut beliau, hadis ini hasan sahih.
 Narrated by al-Tirmizi (586). According to him this hadith is hasan gharib.
 See Fath al-Bari Syarh Sahih al-Bukhari, 2/37
 See Zaad al-Ma’ad, 4/222
 See al-Fawakih al-Dawani ‘ala Risalah Ibn Abi Zaid al-Qairawani, 1/198