Open hugeps opened 6 years ago
Basically looks like the foreign key field is not added into the SQL statement for a nested table element. Is there anything obvious I'm missing ?
$order = new Order($x); // Naturally items in array have no ids
table is linked as follows:
public function details() { return $this->hasMany('App\Detail', 'order_id'); }
there's also belong to on detail:
public function order() { return $this->belongsTo('App\Order','order_id'); }
Thanks for reporting. Could you show the full code for each model class, as well as the database schema? (Run show create table $TABLENAME in a mysql prompt).
show create table $TABLENAME
Basically looks like the foreign key field is not added into the SQL statement for a nested table element. Is there anything obvious I'm missing ?
$order = new Order($x); // Naturally items in array have no ids
table is linked as follows:
there's also belong to on detail: