526
GB
To soft-delete all questions for assignment_id=2 in Laravel
IN
लारवेल में असाइनमेंट_आईडी=2 के सभी प्रश्नों को सॉफ्ट-डिलीट करने के लिए
A
Question::where('assignment_id',2)->delete() with SoftDeletes trait
प्रश्न::where('assignment_id',2)->delete() with SoftDeletes विशेषता
B
Question::where('assignment_id',2)->forceDelete()
प्रश्न::कहां('असाइनमेंट_आईडी',2)->फोर्सडिलीट()
C
DB::table('questions')->where('assignment_id',2)->delete()
डीबी::तालिका('प्रश्न')->कहां('असाइनमेंट_आईडी',2)->हटाएं()
D
Question::truncate()
प्रश्न::काटना()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
With SoftDeletes trait: delete() sets deleted_at timestamp instead of physically removing rows.
व्याख्या (हिन्दी)
SoftDeletes विशेषता के साथ: delete() पंक्तियों को भौतिक रूप से हटाने के बजाय टाइमस्टैम्प पर delete_at सेट करता है।