4

i wonder that what is the differences in performance and usage advantage ?

public function delete(){
    \Session::flash('success', __('common.message.success.delete'));
}

vs

public function delete(){
    $request->session()->flash('success', __('common.message.success.delete'))
}

please explain it with an open example. which one is the best performance provide and which one of the right way usage at session ?

VC.One
  • 14,790
  • 4
  • 25
  • 57
Hanik
  • 317
  • 2
  • 6
  • 25

1 Answers1

2

They are just different ways of accessing your application's session object. With laravel You can access application session

  1. Using session facade as Session::
  2. Using request's session method $request->session()

You can read on it here laravel docs for session. Hope it helps !

Nauman Zafar
  • 1,083
  • 15
  • 40
  • i read it before tons of but i did not find some information about performance. main goal is performance in here. thanks for your answer – Hanik May 15 '17 at 13:33