我在这段代码的第23行得到了PHP语法错误,意外')',看不到问题[重复]

This question already has an answer here:

new to PHP so I'm struggling to see why this is a syntax error, a correction and some advice would be great, thanks! Code below:

<?php
namespace App\Http\Controllers;

use App\User;
use App\Chatkit;
use Illuminate\Http\Request;

class UserController extends Controller
{
    public function create(Request $request, Chatkit $chatkit)
    {
        $data = $request->validate([
                                   'name' => 'required|string|max:255',
                                   'password' => 'required|string|min:6',
                                   'email' => 'required|string|email|max:255|unique:users',
                                   ]);

        $data['chatkit_id'] = str_slug($data['email'], '_');

        $response = $chatkit->createUser([
                                         'id' => $data['chatkit_id'],
                                         'name' => $data['name']
                                         );

        if ($response['status'] !== 201) {
            return response()->json(['status' => 'error'], 400);
        }

        return response()->json(User::create($data));
    }
}
</div>