عَنِ الْبَرَاءِ بْنِ عَازِبٍ رَضِيَ اللَّهُ عَنْهُ أَنَّهُ كَانَتْ لَهُ نَاقَةٌ ضَارِيَةٌ فَدَخَلَتْ حَائِطًا فَأَفْسَدَتْ فِيهِ فَقَضَى رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ أَنَّ حِفْظَ الْحَوَائِطِ بِالنَّهَارِ عَلَى أَهْلِهَا وَأَنَّ حِفْظَ الْمَاشِيَةِ بِاللَّيْلِ عَلَى أَهْلِهَا وَأَنَّ مَا أَصَابَتِ الْمَاشِيَةُ بِاللَّيْلِ فَهُوَ عَلَى أَهْلِهَا
It is narrated from Sayyiduna Bara’ bin Azib (may Allah be pleased with him), he says: My she-camel was accustomed to grazing in people's fields. One day she entered a garden and caused damage to it. Regarding this, the Messenger of Allah (peace and blessings be upon him) decided that during the day, the protection of gardens is the responsibility of their owners, and at night, the care of livestock is the duty of their owners, and for any damage caused by animals at night, their owners will be held responsible.