i would like to do something like, user will enter user_id into a text box, by the time user leave the text field, it will auto search for the user name and other information and then display beside the user_id text box. I know this need jquery to get data from database and display the data from the ajax result, but I'm not very sure how to do this. Can you some help me please? Thanks
class TestController extends Controller
{
public function index()
{
return view('index');
}
public function name($id)
{
// Get id from database, just skiping this step there
$name = 'some_name';
return response()->json(['name' => 'some_name']);
}
}