everything looks ok to me, mmm try to create a survey like this:
$survey = new Survey();
$survey->name = 'Name';
$user->surveys()->save( $survey );
dd( $surver->user_id );
Thanks for your reply. Still null though, both in the DB and in the dd output
If I dd( $user->Id ); I get int 2. I am using L41.
i just note the "I" char in "Id" capitalized, is that a typo??
This is it! The field was actually also capitalized in the database. That was not an issue for inserting data, but for the relationship eloquent apparently calls for lower case field names.
Thank you so much for your help man.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community