/**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, Request $request)
 {
     //$this->validate($request, ['name' => 'required']); // Uncomment and modify if needed.
     $person = People::findOrFail($id);
     $person->update($request->all());
     return redirect('person');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     // People route-model binding
     $router->bind('peoples', function ($id) {
         return \App\People::findOrFail($id);
     });
     // Project route-model binding
     $router->bind('projects', function ($id) {
         return \App\Project::findOrFail($id);
     });
     // Publication route-model binding
     $router->bind('publications', function ($id) {
         return \App\Publication::findOrFail($id);
     });
     // Email route-model binding
     $router->bind('emails', function ($id) {
         return \App\Email::findOrFail($id);
     });
 }
 /**
  * @param $id
  * @return \Illuminate\View\View
  */
 public function getAddroleindex($id)
 {
     $person = People::findOrFail($id);
     $roles = Role::lists('name_rol', 'id');
     $branches = Branch::lists('name', 'id');
     return view('admin.addroles.addrole', compact('person', 'roles', 'branches'));
 }
Ejemplo n.º 4
0
 /**  
  * Delete a given person
  *
  * @return Response
  */
 public function destroy($id)
 {
     $people = People::findOrFail($id);
     $people->delete();
     $message = trans('people.delete_success_message');
     return redirect('people')->with('OK', $message . ' : ' . $people->name . ' ' . $people->last_name);
 }