public function show($id) { $data = array(); $social_actions = SocialAction::getById($id); if ($social_actions == false) { return App::abort('404'); } $photos = Photo::where('type_name', '=', 'social_actions')->where('type_id', '=', $social_actions->id)->where('status', '=', 1)->get(); $donations = Donation::with(array('user'))->where('type_name', '=', 'social_actions')->where('type_id', '=', $social_actions->id)->where('status', '=', 1)->orderBy('id', 'desc')->get(); $user = User::getUserId($social_actions->user_id); $social_target_id = SocialTarget::getAll(); $social_action_category_id = SocialActionCategory::getAll(); $city_id = City::getAll(); $data = array('social_action' => $social_actions, 'photos' => $photos, 'donations' => $donations, 'user' => $user, 'social_target_id' => $social_target_id, 'social_action_category_id' => $social_action_category_id, 'city_id' => $city_id); return View::make('bagikasih.social-action.detail', $data); }