Example #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, StaffRequest $request)
 {
     $staff = Staff::findOrFail($id);
     $staff->update($request->all());
     Session::flash('message', 'Staff successfully updated!');
     return redirect('staff');
 }
 public function update($id, RegisterStaff $request)
 {
     $staff = Staff::findOrFail($id);
     $staff->update($request->all());
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $staff = Staff::findOrFail($id);
     $staff->delete();
     return \Redirect::route('manage.staff.index')->with('warning', 'The staff has been deleted!');
 }
 public function showStaffDetail($slug, $id)
 {
     $data['staff'] = Staff::findOrFail($id);
     if ($slug != $data['staff']->slug) {
         return Redirect::route('site.show.staff.detail', $data['staff']->slug, $id);
     }
     return view('site.staff-detail', $data);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $staff = Staff::findOrFail($id);
     try {
         File::delete(public_path() . '/uploads/staff/' . $staff->image);
         $staff->destroy($id);
     } catch (Exception $e) {
         App::abort(404);
     }
     return Redirect::route('admin.staff.show');
 }
 /**
  * Delete an staff.
  * Responds to requests to DELETE /staff/{id}
  *
  * @param  int  $id  the ID of the staff
  * @return Response
  */
 public function destroy($id)
 {
     if (Auth::user()->staff_id != $id) {
         $staff = Staff::findOrFail($id);
         $email = $staff->email;
         Mail::send('emails.remove_staff', compact('staff'), function ($message) use($email) {
             $message->subject('Your CareGuide Staff account has been removed.');
             $message->bcc($email);
         });
         $staff->delete();
         return back()->with('success', 'Staff is removed successfully!');
     } else {
         return redirect('staff')->withErrors(['You cannot remove your own profile.']);
     }
 }
 public function show($id)
 {
     $staff = Staff::findOrFail($id);
     return view('staff.show', compact('staff'));
 }