I want to add the array value in Session. But it overwrite instead of adding new value.
This is the process of the function.
public function example(){
$fileName = $file . "_demo_a.htm";
$demo["filename"][] = $fileName;
Session::put($demo);
}
For example , when I run the functino for $file = a , the value is added in Session.But for the next time like $file = b , the value is overwritten.
The result what I want is like this ,
array (
'filename' =>
array (
0 => 'a_demo.htm',
1 => 'b_demo.htm'
),
)