Support the ongoing development of Laravel.io →
Artisan Cache Laravel

Hi Guys. I have a problem with running my laravel app. When I try cmd "php artisan serve" in throw me error like "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 in C:\Users\ASUS\OneDrive\Plocha\Frontend\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1349"

When I write cmd composer update than another problem I get the same problem with "Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255"

Please, can someone help me?

0
moderator

Hello @danielcok17 what is the Laravel version that you use?

In the current version does the function match the required signature, see: https://github.com/laravel/framework/blob/9.x/src/Illuminate/Collections/Collection.php#L1666=

So I suspect you have an older Laravel version that doesn't work on your PHP version.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Daniel danielcok17 Joined 12 Jun 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.