Ejemplo n.º 1
0
 /**
  * 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');
 }
Ejemplo n.º 2
0
 /**
  * Редактирование клиента
  */
 public function editPerson(Requests\PersonCreate $request)
 {
     $person = Person::findOrFail($request->input('id'));
     $person->update($request->all());
     return redirect()->back();
 }