Try running composer update
Jul 15, 2022
12
Level 1
problem running laravel 7 code after update php7 to php 8
My code is in Laravel framework 7 and I used php ver 7 before. I recently just updated my apache and php to latest version: apache 2.4.54 php 8.1.8
when I try to view my laravel page it gives me the following error:
Deprecated: Return type of Illuminate\Container\Container::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 D:\www\heymart\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1271
Deprecated: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1282
Deprecated: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1294
Deprecated: Return type of Illuminate\Container\Container::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 D:\www\heymart\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1307
Deprecated: Return type of Illuminate\Routing\AbstractRouteCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php on line 245
Deprecated: Return type of Illuminate\Routing\AbstractRouteCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php on line 235
Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\http-foundation\ParameterBag.php on line 205
Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\http-foundation\ParameterBag.php on line 215
Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\http-foundation\HeaderBag.php on line 255
Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\http-foundation\HeaderBag.php on line 265
Deprecated: Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Http\Request.php on line 637
Deprecated: Return type of Illuminate\Http\Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Http\Request.php on line 651
Deprecated: Return type of Illuminate\Http\Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Http\Request.php on line 663
Deprecated: Return type of Illuminate\Http\Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Http\Request.php on line 674
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in D:\www\heymart\vendor\symfony\http-foundation\Request.php on line 303
Deprecated: mb_strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Support\Str.php on line 177
Deprecated: mb_strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Support\Str.php on line 177
Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\vlucas\phpdotenv\src\Repository\AbstractRepository.php on line 147
Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\vlucas\phpdotenv\src\Repository\AbstractRepository.php on line 155
Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\vlucas\phpdotenv\src\Repository\AbstractRepository.php on line 163
Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\vlucas\phpdotenv\src\Repository\AbstractRepository.php on line 171
Deprecated: Return type of PhpOption\None::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\phpoption\phpoption\src\PhpOption\None.php on line 118
Deprecated: Return type of PhpOption\Some::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\phpoption\phpoption\src\PhpOption\Some.php on line 152
Deprecated: Return type of Illuminate\Config\Repository::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 D:\www\heymart\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 141
Deprecated: Return type of Illuminate\Config\Repository::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 152
Deprecated: Return type of Illuminate\Config\Repository::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 164
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 D:\www\heymart\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 175
Deprecated: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Finder.php on line 607
Deprecated: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Finder.php on line 676
Deprecated: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\FileTypeFilterIterator.php on line 42
Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php on line 85
Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php on line 113
Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php on line 61
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 55
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 74
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 79
Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\FilenameFilterIterator.php on line 28
Deprecated: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\www\heymart\vendor\symfony\finder\Iterator\PathFilterIterator.php on line 27
looks like my laravel code use Deprecated function. Can anyone help me with the proper way to fix this issue?
Best regards Zigma
Please or to participate in this conversation.