I have created a session that stores an array, now I am facing a problem if I want to add more items into the session array
if(session()->has('key')){
$tests = Test::all()->where('id', 3);
$res = collect($tests);
session()->push('key', $res);
}else{
$tests = Test::where('id', 1)->get();
$res = collect($tests);
session()->put('key', $res);
}
if I die and dump the session result this is what I get
this is the result that I want

