Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When $haystack is null or is not a string, mb_strpos throws a 500 PHP error. I'm not sure how I got the 500 error, but have three environments in the same server sharing the same database, all running the same app with different subdomains. Session is managed with the files drive, but cache uses the database driver. Two sites run as expected, and the other one wasn't able to handle the request. After checking the PHP error log:
[proxy_fcgi:error] [pid 256670] [client 190.104.120.178:59913] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: mb_strpos(): Argument #1 ($haystack) must be of type string, null given, called in /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Support/Str.php on line 177 and defined in /var/www/test2.readforall.com/vendor/symfony/polyfill-mbstring/bootstrap80.php:60\nStack trace:\n#0 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(177): mb_strpos()\n#1 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(34): Illuminate\Support\Str::contains()\n#2 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(371): Illuminate\Http\Request->isJson()\n#3 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(435): Illuminate\Http\Request->getInputSource()\n#4 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(64): Illuminate\Http\Request::createFromBase()\n#...'
And adding the propose change, I was able to run the application as expected.