Hi, I am new to laravel. I am getting an error while using collect.js function that I cannot figure out.
my code in my controller is:
$users = User::all(); $collection = collect($users); dd($collection.sortBy('first_name'));
my error is :
Call to undefined function App\Http\Controllers\sortBy()
Can someone tell me what is wrong?
or is collect.js not suppose to be used this way?