laravel json return data

public function index() {
    $row = User::all();
    return response()->json($row);
}