-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default values on fields when creating #493
Comments
You can pass this by $attributes in Model
|
Sweet, tyvm 👍 |
Also if you need method calls you can set it on the resource public static function newModel()
{
$model = new static::$model;
$model->setAttribute('user_id', auth()->id());
return $model;
} |
Where in the nova source does this get read? |
@notflip when nova instantiates a model, those values come pre-filled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to add a default value on fields? This value would be used only when creating.
Something like this maybe:
Field::make('My field')->defaultValue('some value')
The text was updated successfully, but these errors were encountered: