public function getTrash($id = '') { if ($id == '') { $companies = Companies::getTrash(); $msg_success = Session::get('msg_success'); $msg_error = Session::get('msg_error'); return View::make('backend.companies.trash', array('companies' => $companies, 'msg_success' => $msg_success, 'msg_error' => $msg_error)); } else { $company = Companies::find($id); $trash = Companies::trash($id); if (!$trash) { return Redirect::to($this->route)->with('msg_error', Lang::get('messages.companies_trash_err', array('title' => $company->title))); } else { return Redirect::to($this->route)->with('msg_success', Lang::get('messages.companies_trash', array('title' => $company->title))); } } }