2

My working project simple form, but I get the error:

ErrorException in 350957ec60e1dd25a26f206394651974bb23e6b7.php line 40: Array to string conversion (View: C:\xampp\htdocs\laravelku\resources\views\siswa\edit.blade.php)

and this my code:

@extends('template')

@section('main')
    <div id="siswa">
        <h2>Edit Siswa</h2>

        {!! Form::model($siswa,['method' => 'PATCH', 'action' => ['SiswaController@update', $siswa->id]]) !!}
        <div class="form-group">
            {!! Form::label('nisn', 'NISN:', ['class' => 'control-label']) !!}
            {!! Form::text('nisn', null,['class' => 'form-control']) !!}
        </div>

            <div class="form-group">
                {!! Form::label('nama_siswa','Nama:',['class' => 'control-label']) !!}
                {!! Form::text('nama_siswa',null,['class' => 'form-control']) !!}
            </div>

        <div class="form-group">
            {!! Form::label('tanggal_lahir','Tanggal Lahir:',['class' => 'control-label']) !!}
            {!! Form::date('tanggal_lahir',null,['class' => 'form-control','id' => 'tanggal_lahir']) !!}
        </div>

        <div class="form-group">
            {!! Form::label('jenis_kelamin','Jenis Kelamin:', ['class' => 'control-label']) !!}
            <div class="radio">
                <label>{!! Form::radio('jenis_kelamin', 'L') !!} Laki-laki</label>
            </div>
            <div class="radio">
                <label>{!! Form::radio('jenis_kelamin','P') !!} Perempuan</label>
            </div>
        </div>

        <div class="form-group">
            {!! Form::submit('Update Siswa'), ['class' => 'btn btn-primary form-control'] !!}
        </div>
        {!! Form::close() !!}
    </div>
    @stop

    @section('footer')
        @include('footer')
    @stop

1 Answer 1

1

The Form::submit() syntax is wrong. Change this:

{!! Form::submit('Update Siswa'), ['class' => 'btn btn-primary form-control'] !!}

To this:

{!! Form::submit('Update Siswa', ['class' => 'btn btn-primary form-control']) !!}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.