/** * Store a newly created resource in storage. * * @param PersonCreate $request * @return Response */ public function store(PersonCreate $request) { $date = $request->all(); // $user = User::find($request->user); $pinfo = new Person(); $pinfo->email = $request->input('email'); $pinfo->phoneNumber = $request->input('phoneNumber'); $pinfo->personalNumber = $request->input('personalNumber'); //dd($pinfo); $user->Person()->save($pinfo); $persons = Person::All(); return redirect()->action('PersonController@index'); }
/** * Редактирование клиента */ public function editPerson(Requests\PersonCreate $request) { $person = Person::findOrFail($request->input('id')); $person->update($request->all()); return redirect()->back(); }