Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MacieG's avatar

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

Hi, i install laravelcollective/html and i have problem on /login and /register.

htmlspecialchars() expects parameter 1 to be string, array given (View: C:\projects\mojastrona.com\resources\views\layouts\app.blade.php) (View: C:\projects\mojastrona.com\resources\views\layouts\app.blade.php)

My login, and register is standard from laravel, but i think if error is from app.blade.php (too from laravel)

Please help me, thanks :)

0 likes
6 replies
tomopongrac's avatar

Did you install correct version of package considering version of laravel which you use

MacieG's avatar

Yes its work on other page and all is great

        "php": ">=5.6.4",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",
        "laravelcollective/html": "^5.4.1"
MacieG's avatar

if i delete all from app.blade.php and here is only

@yield('content')

it work

MacieG's avatar
MacieG
OP
Best Answer
Level 1

I replace

<html lang="{{ config('app.locale') }}">

to

<html lang="en"

and now work, thanks

1 like
azzwho's avatar

it is not working with this change..

-> <html lang="en"

MacieG's avatar

Hi, can you show me your code? From blade file?

Please or to participate in this conversation.