Reputation: 19557
What is the difference between the Session::set
and Session::put
methods in Laravel? The docs only covers Session::put
, but I have seen set
used instead.
Upvotes: 9
Views: 6137
Reputation: 19557
They are exactly the same. Session::put
directly calls Session::set
.
The only difference, is that Session::put
allows you to pass it an array of [key => value]
pairs, in which case it calls Session::set
for each of them.
These methods are defined in Illuminate\Session\Store
Upvotes: 10