mardi 26 avril 2016

How to solve Method App\JenisSurat::__toString() must return a string value on Laravel 5?

I want to input data to database. I am using Laravel 5. When I clicked the submit button. I got an error like the image below. Here is controller:
`

    public function tambahjenissurat(Request $request)
{       $this->validate($request, [
        'jenis_surat' => 'required'
    ]);

    $jenis_surat = $request['jenis_surat'];

    $jenis_surat = new JenisSurat();
    $jenis_surat->jenis_surat = $jenis_surat;

    $jenis_surat->save();

    return redirect()->route('jenissurat');
}`



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire