Skip to content

Commit 11e8e3a

Browse files
committed
Adds comments
1 parent efd8889 commit 11e8e3a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/TurboStreamResponseMacro.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ public function __construct(TurboStreamModelRenderer $renderer)
1616

1717
public function handle(Model $model, string $action = null)
1818
{
19-
if (! $model->exists ||
20-
(method_exists($model, 'trashed') && $model->trashed())
21-
) {
19+
// We're treating soft-deleted models as they were deleted. In other words, we
20+
// will render the deleted Turbo Stream. If you need to treat a soft-deleted
21+
// model differently, you can do that on your deleted Turbo Stream view.
22+
23+
if (! $model->exists || (method_exists($model, 'trashed') && $model->trashed())) {
2224
return $this->renderModelDeletedStream($model);
2325
}
2426

0 commit comments

Comments
 (0)