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.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire