Toggle without mass assignement

Hi guys,
I want to add toggle to my UserResource and use value from it in afterCreate hook to generate and send password via email. But I dont want to have this value from toggle saved on model.
// UserResource.php
Forms\Components\Toggle::make('send_credentials')
    ->label(__('Send user email with credentials'))
    ->visibleOn('create'),

// CreateUser.php
public function afterCreate(): void
{
    ray($this->send_credentials);
}


How can I prevent this error:
Add fillable property [send_credentials] to allow mass assignment on [App\Models\User].
and access that property on afterCreate hook?
Was this page helpful?