Laravel sessions

Posted 1 year ago by Alderwiereld

Helllo I am new to laravel. I am experiencing this problem in my blog, i want to fetch the id of a logged in user from sessions which is currently returning the following array. the code i have on my controller is $data = $request->session()->all(); dd($data); and the results i am getting is array:5 [▼ "_flash" => array:2 [▶] "_token" => "bY8Etjdv03et6dXvPraX6FIyzP0lcNfb4AH4INaG" "_previous" => array:1 [▶] "url" => [] "login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d" => 3 ]

what i want to achieve is to be able to fetch the the value 3 alone on the last line

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.