Retrieve single column value from a table

Posted 1 year ago by Alderwiereld

I am presently having the following query

$user_id = Auth::user()->id; $picture = Profile::all()->where('user_id','=',$user_id)->pluck('profile'); return $picture;

what it achieves is the following output

["1000profilepic.jpeg"]

However i want it to return the value

1000profilepic.jpeg

because i want to make use of the same value inside the same controller

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

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.