I'm figuring out how to work with Lumen (a stripped Laravel framework) and am a bit stuck on the ORM / query builder.
I have the following function, which currently isn't working, and want it to display all the users starting with the letter 'b'.
public function getUsers()
{
$users = User::where('name', 'b%')->get();
return response()->json($users);
}
How do I approach this? I'm so used to plain SQL that I'm confused about this query builder. So how do I fetch all the users starting with the letter 'b'?
Thank you for taking the time to read and hopefully answer my question.