Answers for "set session array in laravel"

PHP
1

set session data in laravel

Session::put('key', 'value');

session(['key' => 'value']);
Posted by: Guest on September-24-2020
1

laravel session add array

// set products.name as array
session()->put('products.name', []);


// somewhere later
session()->push('products.name', $name1);

// somewhere else later
session()->push('products.name', $name2);
Posted by: Guest on July-20-2021

Browse Popular Code Answers by Language