コード例 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(EmployeeRequest $request, $id)
 {
     $employee = Employee::findOrFail($id);
     $employee->update($request->all());
     flash()->success('Success!', 'Employee details saved successfully!');
     return redirect('employees');
 }
コード例 #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(EmployeeRequest $request, $id)
 {
     $employee = Employee::findOrfail($id);
     $employee->fill($request->all());
     $employee->save();
     return redirect(route('employees.index'))->with('message', 'Empleado actualizado corectamente');
 }
コード例 #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\EmployeeRequest $request)
 {
     //
     $data = $request->except('_token');
     $data['user_id'] = \Auth::User()->id;
     $employee = new Employee();
     $employee->create($data);
     return back();
 }
コード例 #4
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(EmployeeRequest $request, $id)
 {
     $employee = $this->employee->where('emp_id', '=', $id)->first();
     $employee->fill($request->input())->save();
     return redirect('employee/' . $employee->emp_id . '/edit')->with('status', 'Successfully Updated.');
 }
コード例 #5
0
 /**
  * Update Employee Information in Database
  * @param EmployeeRequest $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function update(EmployeeRequest $request, $id)
 {
     $employee = Employee::query()->findOrFail($id);
     if ($request->hasFile('image')) {
         $image_name = $request->eid . '.' . $request->file('image')->getClientOriginalExtension();
         $request->file('image')->move(base_path() . '/resources/assets/images/employee', $image_name);
         $data = $request->except('image');
         $data['image'] = $image_name;
         $employee->update($data);
     } else {
         $employee->update($request->except('image'));
     }
     Session::flash('success_message', 'Employee Updated Successfully');
     return redirect('employee');
 }
コード例 #6
0
ファイル: EmployeesController.php プロジェクト: saj696/pipe
 public function update($id, EmployeeRequest $request)
 {
     $employee = Employee::findOrFail($id);
     $file = $request->file('photo');
     $destinationPath = base_path() . '/public/image/employee/';
     if ($request->hasFile('photo')) {
         $name = time() . $file->getClientOriginalName();
         $file->move($destinationPath, $name);
         $employee->photo = $name;
     }
     $employee->name = $request->input('name');
     $employee->mobile = $request->input('mobile');
     $employee->email = $request->input('email');
     $employee->present_address = $request->input('present_address');
     $employee->permanent_address = $request->input('permanent_address');
     $employee->dob = $request->input('dob');
     $employee->designation_id = $request->input('designation_id');
     $employee->workspace_id = $request->input('workspace_id');
     $employee->employee_type = Config::get('common.employee_type.Regular');
     $employee->joining_date = $request->input('joining_date');
     $employee->updated_by = Auth::user()->id;
     $employee->updated_at = time();
     $employee->update();
     Session()->flash('flash_message', 'Employee has been updated!');
     return redirect('employees');
 }
コード例 #7
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  EmployeeRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(EmployeeRequest $request)
 {
     Employee::create($request->all());
     session()->flash('flash_message', 'Werknemer toegevoegd!');
     return redirect('werknemers');
 }
コード例 #8
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(EmployeeRequest $request)
 {
     Employee::create($request->all());
     return redirect('employee');
 }