Hello I want to changing some data in hasMany property
exp.
current data in hasMany [1,2,3]
$data = []
$data[] = <obj 4>
foreach($master->hasManyCollections as $item) {
if($item->id == 1) {
$item->delete();
}
}
$master->hasManyCollections = $data;
$master->save();
foreach($master->hasManyCollections as $item) {
var_dump($item->id);
}
I want to show this items [2,3,4] but have [1,2,3] even adding setIsFresh to false, but after refresh page is OK
How to show current collections after model->save or before where the more I care because of the validation