I have 1 to 1 model (model1 <-1---1->model1.0) and i have model2.0 like below:
+------+ +---------+
| | +--1-+model1.0 |
|model1+-1--+ +---------+
| | +----------+
+------+ |model2.0 |
+----------+
Parent model:
model1 class: { $this->HasOne(ChildModel::class); }
Child Model:
model1.0 class: {$this->belongsTo(Model1::class); }
Questions: how do i swing from model1.0 to model 2.0? like below:
+------+ +---------+
| | |model1.0 |
|model1+-1--+ +---------+
| | | +----------+
+------+- +-------------1-|model2.0 |
+----------+
note:
model1 and model1.0 is in database but model2.0 is still in controller as object variable.
model1.0 and model2.0 is object of the same model class