Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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'));
 }
Ejemplo n.º 3
0
 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);
 }