I copied fresh new laravel project from my repository and was having trouble with ArrayAccess functions. As this will be depricated with version PHP 8.0 and PHP 8.1.
Does anyone have a quick guide to fix this for legacy projects?
Deprecated: Return type of Illuminate\Config\Repository::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in
Here the fix i followed and hopefully you can follow the same steps.
This guide only works on php@7.4 Please use only if u are on the latest version of php@7.4
composer global update
composer du
brew unlink php@7.4
brew link php@7.4 --force
valet use php@7.4 --force
After restarting nginx it worked.