Beispiel #1
0
 public function getUpdateLink($id)
 {
     $link = Link::find($id);
     $uc = UserCategories::all();
     $usercategories = array();
     foreach ($uc as $ucc) {
         $usercategories[$ucc->id] = $ucc->name;
     }
     $mjc = MajorCategories::where('user_categories_id', '=', $link->MiddleCategories->MajorCategories->UserCategories->id)->get();
     foreach ($mjc as $mjcc) {
         $majorcategories[$mjcc->id] = $mjcc->name;
     }
     $mdc = MiddleCategories::where('major_categories_id', '=', $link->MiddleCategories->MajorCategories->id)->get();
     foreach ($mdc as $mdcc) {
         $middlecategories[$mdcc->id] = $mdcc->name;
     }
     $goverment = Gov::all();
     $selected = array();
     foreach ($goverment as $gov) {
         $selected[$gov->id] = $gov->name;
     }
     return View::make('admin.update_link')->with('link', $link)->with('usercategories', $usercategories)->with('majorcategories', $majorcategories)->with('middlecategories', $middlecategories)->with('goverment', $selected);
 }
Beispiel #2
0
 public function getManageGov()
 {
     return View::make('admin.manage_gov')->with('goverment', Gov::all());
 }