Skip to content
Discussion options

You must be logged in to vote

Update (to be tested further): Looking at the source code, it seems like if you return a callable in fillAttributeFromRequest, it is executed after the model. However, I'm gonna have to explore if I can retrieve the actual saved model (with the attributed ID) from there.

Edit: It seems like the model is hydrated properly in both creation and update scenarios (thanks to PHP object properties being references).

Here's a sample of how to achieve an "after save" behavior on fields:

/**
 * Hydrate the given attribute on the model based on the incoming request.
 *
 * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
 * @param  string  $requestAttribute
 * @param  object  $model
 * @para…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by piljac1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant