You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,14 @@ The `become()` method will return a new instance of the specified child model wi
239
239
240
240
This is also useful when you're using observers or callbacks, since the specific child model's behavior will be triggered after the transition.
241
241
242
+
A new model event is fired when a model is _becoming_ another type, you may listen to it like so:
243
+
244
+
```php
245
+
ShippedOrder::becoming(function ($shippedOrder) {
246
+
// Do something before the model is saved...
247
+
});
248
+
```
249
+
242
250
## Laravel Nova Support
243
251
244
252
If you want to use share parent Nova resources with child models, you may register the following provider at the end of the boot method of your NovaServiceProvider:
0 commit comments