Local server PHP Version 8.1.4, laravel project. Inside composer.json
file I have:
"php": "^7.2.5", version & "laravel/framework": "^7.0"
Error:
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
That's a php version issue. Upgrade laravel or downgrade PHP. This article covers how to downgrade the PHP version so it matches the Laravel Version.
https://bytexd.com/fix-laravel-return-type-of-illuminatesupportcollectionoffsetexistskey/
in your composer.json update line
"php": "^7.3",
to
"php": "^7.3|^8.1",
and run composer update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With