mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
632 B
632 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| Use the nullOrDelete() method in your relationship column definitions to clear their value when the parent record gets deleted | 1461703828953198601 | weekly-thread-2021-46 | mmartin_joo |
|
2021-11-19T14:32:04+00:00 | use-the-nullordelete-method-in-your-relationship-column-definitions-to-clear-their-value-when-the-parent-record-gets-deleted |
🔥#Laravel Migration tip🔥
Do you have a relationship that is nullable?
You can use the nullOnDelete() function. It achieves ON DELETE SET NULL behavior: