Laravel makes communication with the database a lot easier with Eloquent. When working with Eloquent Relationships you should be aware when calling dynamic variables (with the help of the magic methods of PHP) that the instances of the models do not reflect new changes, but are stored permanently when they are first called.
The following example behaves as expected:
6d32588c32f080ef1896633f261e1e14
$ model-> col always returns the old value even after the change (because the value was initially fetched once with Model :: find (42) and then saved). If you now address another, connected table with $ model-> dependent_table , you could expect that its second call would return the new value:
6d32588c32f080ef1896633f261e1e14
This is also not the case ( $ dependent_table = $ model-> dependant_table caches the entire dependent table). To get a current value, the explicitly defined function dependant_table () is called:
6d32588c32f080ef1896633f261e1e14