create(); $this->withToken($user->createToken('koel')->plainTextToken); return parent::json($method, $uri, $data, $headers); } protected function getAs(string $url, ?User $user = null): TestResponse { return $this->jsonAs($user, 'get', $url); } protected function deleteAs(string $url, array $data = [], ?User $user = null): TestResponse { return $this->jsonAs($user, 'delete', $url, $data); } protected function postAs(string $url, array $data, ?User $user = null): TestResponse { return $this->jsonAs($user, 'post', $url, $data); } protected function putAs(string $url, array $data, ?User $user = null): TestResponse { return $this->jsonAs($user, 'put', $url, $data); } protected function patchAs(string $url, array $data, ?User $user = null): TestResponse { return $this->jsonAs($user, 'patch', $url, $data); } }