public function edit($id) { $param['pageNo'] = 2; $param['company'] = CompanyModel::find($id); $param['cities'] = CityModel::all(); $param['categories'] = CategoryModel::all(); return View::make('admin.company.edit')->with($param); }
public function edit($id) { $title = Lang::get('admin/works/title.blog_update'); $work = $this->work->with('categories')->find($id); $categories = \Category::all(); if (is_null($work)) { return Redirect::route('admin.works.index'); } return View::make('admin/works/edit', compact('work', 'title', 'categories')); }
public function delete($id) { try { CategoryModel::find($id)->delete(); $alert['msg'] = 'Category has been deleted successfully'; $alert['type'] = 'success'; } catch (\Exception $ex) { $alert['msg'] = 'This Category has been already used'; $alert['type'] = 'danger'; } return Redirect::route('admin.category')->with('alert', $alert); }