Skip to main content
InterviewHubPRO
Section Overview
Q28

Question 28 of 50

Part 3: Octane, High-Throughput Scaling & Enterprise Design (25 - 35)

56%
Laravel & Ecosystem (50 Qs)•Part 3: Octane, High-Throughput Scaling & Enterprise Design (25 - 35)

How does Soft Deleting work in Eloquent?

senior LevellaravelOctane

In Simple Words: Adds a deleted_at timestamp column to the table:

  • When $user->delete() is called, Eloquent sets deleted_at = NOW() instead of executing a SQL DELETE.
  • Automatically injects a Global Scope on all queries: WHERE deleted_at IS NULL.
  • Access soft-deleted records via User::withTrashed()->get() or restore them via $user->restore().