Last active
March 26, 2019 12:20
-
-
Save toonvandenbos/bdde311a47be8e973a1ef1fa269843e1 to your computer and use it in GitHub Desktop.
Examples used in Medium Post "Making Laravel Nova custom fields more developer-friendly"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function fillAttributeFromRequest(NovaRequest $request, $requestAttribute, $model, $attribute) | |
{ | |
if ($request->exists($requestAttribute)) { | |
$value = $this->handleIncomingRequestValue($request[$requestAttribute]); | |
// Now we're storing a verified or manipulated value | |
$model->{$attribute} = $value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment