If you ever encountered an error message in Laravel similar to
illegal offset type.
It probably means you are trying to get the wrong key from the array or trying to get a key from a NULL object.
In this case,
dd() is your friend, you can use
dd() to investigate the array or object you are trying to access and find the correct key value.