/** * Delete the specified setting. * * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function delete($id) { if ($setting = $this->settings->onlyTrashed()->find($id)) { // Completely delete from database $setting->forceDelete(); // Redirect with messages return Redirect::to(route('admin.settings.index'))->with('success', 'Setting Permanently Deleted!'); } return Redirect::to(route('admin.settings.index'))->with('error', 'Setting Not Found!'); }
/** * Remove the specified user. * * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function delete($id) { // Get user from id fetch if ($user = $this->users->onlyTrashed()->find($id)) { // Delete from pivot table many to many $this->users->onlyTrashed()->find($id)->roles()->detach(); // Permanently delete $user->forceDelete(); return Redirect::to(route('admin.users.index'))->with('success', 'User Permanently Deleted!'); } return Redirect::to(route('admin.users.index'))->with('error', 'User Not Found!'); }