Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
114 views
in Technique[技术] by (71.8m points)

laravelcollective - Can't seem to find a solution for this error in Laravel

Here is the error:

syntax error, unexpected token "=>", expecting ")"

And here is my code:

{{Form::open (array ('url' => 'logincheck'))}}

    <p> {{Form::text ('username', string ('placeholder'=>'Username','maxlength'=>30))}} </p>

    <p> {{Form::password ('password', string('placeholder'=>'Password','maxlength'=>30))}} </p>

    <p> {{Form::submit ('Submit')}} </p>

{{Form::close ()}}
question from:https://stackoverflow.com/questions/66046002/cant-seem-to-find-a-solution-for-this-error-in-laravel

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Change the string(... to array(...

I recommend you use the short array syntax like that:

{{ Form::text('username', ['placeholder' => 'Username', 'maxlength' => 30]) }}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...