29 return View::make(
'companies/index')->with(
'companies', Company::all());
41 return View::make(
'companies/edit')->with(
'company',
new Company);
55 $company->name = e(Input::get(
'name'));
57 if ($company->save()) {
58 return Redirect::to(
'admin/settings/companies')
59 ->with(
'success', trans(
'admin/companies/message.create.success'));
61 return Redirect::back()->withInput()->withErrors($company->getErrors());
77 if (is_null($company = Company::find($companyId))) {
78 return Redirect::to(
'admin/settings/companies')
79 ->with(
'error', trans(
'admin/companies/message.does_not_exist'));
81 return View::make(
'companies/edit')->with(
'company', $company);
95 if (is_null($company = Company::find($companyId))) {
96 return Redirect::to(
'admin/settings/companies')->with(
'error', trans(
'admin/companies/message.does_not_exist'));
100 $company->name = e(Input::get(
'name'));
102 if ($company->save()) {
103 return Redirect::to(
'admin/settings/companies')
104 ->with(
'success', trans(
'admin/companies/message.update.success'));
106 return Redirect::to(
"admin/settings/companies/$companyId/edit")
107 ->with(
'error', trans(
'admin/companies/message.update.error'));
123 if (is_null($company = Company::find($companyId))) {
124 return Redirect::to(
'admin/settings/companies')
125 ->with(
'error', trans(
'admin/companies/message.not_found'));
129 return Redirect::to(
'admin/settings/companies')
130 ->with(
'success', trans(
'admin/companies/message.delete.success'));
131 }
catch (\Illuminate\Database\QueryException $exception) {
136 if ($exception->getCode() == 23000) {
137 return Redirect::to(
'admin/settings/companies')
138 ->with(
'error', trans(
'admin/companies/message.assoc_users'));
getIndex()
Returns view to display listing of companies.
This controller handles all actions related to Companies for the Snipe-IT Asset Management applicatio...
getEdit($companyId)
Return form to edit existing company.
postCreate()
Save data from new company form.
postEdit($companyId)
Save data from edit company form.
getCreate()
Returns view to create a new company.
postDelete($companyId)
Delete company.