public function get_activity($brand_id) { $brand_data = brand::find($brand_id, array('title')); $campaigns = BrandCampaign::where('brand_campaign.brand_id', '=', $brand_id)->left_join('campaign', 'campaign.id', '=', 'brand_campaign.campaign_id')->left_join('campaign_author', 'campaign_author.id', '=', 'campaign.author_id')->get(array('brand_campaign.*', 'campaign.campaign_title', 'campaign.author_id', 'campaign.campaign_rating', 'campaign.campaign_price', 'campaign.campaign_status', 'campaign.created_at', 'campaign.updated_at')); if (empty($campaigns)) { return Redirect::to_route('brand_admin')->with('errors', 'Brand Activity not founded !'); } return View::make('admin/brand/activity')->with('campaigns', $campaigns)->with('brand_title', $brand_data->title); }