Related fields not saving #1130
Replies: 2 comments 1 reply
-
Hey @infiniteroles Try this:
OR
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I will open a new one with new information a better data about my issue. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I’m having an issue with the related fields in my CRUD. I have a CRUD that displays several fields from its own model, and two fields from a related model. I’m doing it like this:
CRUD::addField([ 'name' => 'risk', 'label' => 'Risk', 'type' => 'select', 'entity' => 'user', 'attribute' => 'risk', 'allows_null' => false, 'model' => "App\Models\User", ]);
And in the model, I have:
public function user() { return $this->belongsTo(User::class); }
When I modify any field and save, those changes are saved correctly, but if I modify the “risk” field, no changes are saved in the database, and I don’t get any errors either.
Thank you very much,
Oscar
Beta Was this translation helpful? Give feedback.
All reactions