lundi 29 janvier 2018

Blank page after submitting form in laravel

I want to add record to my DB using laravel but after submitting form I get blank screen and no logs, here's my code:

public function store(Request $request)
    {
        foreach(Auth::user()->test as $data) {
                if($request->name == $data->name) {
                    return back()->with('wrong', trans('settings.isset.name')); 
                }
                else {
                    $this->validate($request, [
                        'name' => 'required',
                    ]);

                    $name = Name::store($request);

                    return back()->with('message', trans('settings.add.name')); 
                }
            }
    }

And there is of course normal working form. Before when I didn't have foreach it was working, but not now.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2EklC3O
via IFTTT

Aucun commentaire:

Enregistrer un commentaire