Cześć, mam taki kod, i powoduje on u mnie błąd Cannot access offset of type string on string
. Nie mogę znaleŹć rozwiązania tego problemu bo nie wiem gdzie jest błąd, ale podejrzewam że jest on w drugim argumencie funkcji where(). Byłbym wdzięczny jeśli ktoś pomógłby mi rozwiązać ten problem.
$user = $this->User::findOrFail($id);
$lastName = $model->lastName;
$result = (array)$lastName;
$variable = Class::where($result, fn($item) => $item['value'] === true);