Hello @shazam7734
I think it can be helpful to read the documentation about the query builder for more information.
I think this is what you want to have:
$surveys = DB::table('surveys')
-->select('name', 'value')
->where('user_id', $user_id)
->orderBy('updated_at', 'DESC')
-->limit(13)
->get();
return view('home',['surveys'=>$surveys]);
PS. I have updated your post to make the codeblocks more readable.
Thank you so much @tvbeek, that did the trick! I am curious how to create code blocks for making my code more readable :)
@shazam7734 I'm not sure if you can edit your first post to see the change.
But the difference is to use three ` and not one. A single one is for inline code and the use of three is for a block of code and also result in highlighting of the code.
I also place them on a separated line (before and after the code)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community