Hey everyone,
I am trying to have all group a lot of models into one accessible collection such as
Forms
----> ModelForm1 - id1
----> ModelForm1 - id2
----> ModelForm2
----> ModelForm3
----> ModelForm4 - id1
----> ModelForm4 - id2
However my attempts have led to the following
Forms
----> 0
-------->ModelForm1 - id1
-------->ModelForm1 - id2
----> 1
-------->ModelForm2 - id1
etc etc,
I tried using the merge and collections but have gotten no where. How would I go about doing this
$forms = collect();
$buildProfile = collect(
['serviceHistory'=>$user->vpf->serviceHistory,
'ribbons'=>$user->vpf->ribbons,
'qualifications'=>$user->vpf->qualifications,
'operations'=>$user->vpf->operations,
'schools'=>$user->vpf->schools,
'forms'=> [$forms->merge([$user->vpf->article15,$user->vpf->vcs,$user->vpf->ncs,$user->vpf->dcs])],
]);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community