lundi 17 décembre 2018

How to fix mb_strpos() expects parameter 1 to be string, array given?

I do the php artisan serve, an error always appears

php artisan serve

In Str.php line 107:
mb_strpos() expects parameter 1 to be string, array given

and when I compose the update the same error always appears.

composer update

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
  - Updating doctrine/dbal (v2.9.0 => v2.9.1): Downloading (100%)
  - Updating opis/closure (3.1.1 => 3.1.2): Downloading (100%)
  - Updating laravel/framework (v5.7.17 => v5.7.18): Downloading (100%)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Str.php line 107:

  mb_strpos() expects parameter 1 to be string, array given


Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

when I open the Str.php file on line 107 then like this.

 public static function contains($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {
                return true;
            }
        }

        return false;
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire