laravel help

Status
Not open for further replies.

Proximity

IDK?
Feb 13, 2014
673
56
I need some assistance with laravel

This is my code

Code:
{{ User::orderBy('id', 'DESC')->limit(1)->first()->pluck('username') }}

it shows the newest registerd user but it doesn't update when someone registers...
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,926
3,920
You don't need to call first(), as pluck() will pick the first instance regardless, and they both call get().

pluck() will also limit the query to one as well, so all you need is:
Code:
{{ User::orderBy('id', 'DESC')->pluck('username') }}
 
Status
Not open for further replies.

Users who are viewing this thread

Top