public function index() { // init $data = array('menu' => $this->_menu, 'title' => 'Kategori Target Sosial', 'description' => '', 'breadcrumb' => array('Kategori Target Sosial' => route('admin.social-target-category'))); // Set categories $data['categories'] = SocialTargetCategory::all(); return View::make('admin.pages.social-target-category.index')->with($data); }
public function update($id) { $data = array('menu' => 'Target Sosial', 'title' => 'Target Sosial', 'description' => '', 'breadcrumb' => array('Target Sosial' => route('admin.social-target'))); if (!Session::has('time') && (!Session::has('validasi') && Session::get('validasi') != 'social_targets')) { $time = time(); Session::put('time', $time); } $social_target = SocialTarget::where('id', $id)->first(); $data['action'] = 'admin.social-target.update.post'; $data['social_target'] = $social_target; $data['social_target_category'] = SocialTargetCategory::all(); $data['user'] = User::all(); $data['city'] = City::all(); // Get Photos that related with this $data['photos'] = Photo::where('type_name', '=', 'social_targets')->where('type_id', '=', $social_target->id)->orderBy('id', 'desc')->get(); // return $data; return View::make('admin.pages.social-target.create')->with($data); }