mardi 14 novembre 2017

Error 500 when post data to database

I'm new in php and Laravel. I get error code 500 when I post my data.

this my form code in my blade :

    <form method="post" class="form-horizontal" id="form"
            action="">
            

and this is my method in my controller :

    public function store(Request $request)
{
    if($request->ajax()){
        $data = collect($request->all())
            ->except(['_token'])
            ->all();

        $akun = SetLinkAkunCoa::create($data);

        if($akun){
            $response = $this->returnSuccess('', trans('messages.success.update'));
            return response()->json($response);
        }else{
            $response = $this->returnData('', trans('messages.error.update'));
            return response()->json($response);
        }
    }
}

Please someone help me to solve this. thank's anyway



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire