app/Http/Controllers/Admin/CampaignController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        if(sizeof(session('permissions')) > 0 && session('permissions')['campaign_management_page'] == 0)
        {
            return abort( 404);
        }
        $allCampaigns = session()->get('all_cmp_ads_list');
        if(session()->get('cur_balance') < 100 && Auth::guard('admin')->user()->id !== 1)
        {
            $sendVal =  [
                'is_active' => false
            ];
            foreach($allCampaigns as $key => $value)
            {
                if($value['is_active'])
                {
                    $allCampaigns[$key] = Report::updateTaboolaCampaigns($value['id'], $sendVal);
                }
            }
        }
        session()->put('all_cmp_ads_list', $allCampaigns);
        return view('admin.campaign.index', ['title'=>__('globals.campaigns.campaign_management'), 'allCampaigns' => $allCampaigns]);
    }
public function index ( ) { if ( sizeof ( session ( 'permissions' ) ) > 0 && session ( 'permissions' ) [ 'campaign_management_page' ] == 0 ) { return abort ( 404 ) ; } $ allCampaigns = session ( ) -> get ( 'all_cmp_ads_list' ) ; if ( session ( ) -> get ( 'cur_balance' ) < 100 && Auth :: guard ( 'admin' ) -> user ( ) -> id !== 1 ) { $ sendVal = [ 'is_active' => false ] ; foreach ( $ allCampaigns as $ key => $ value ) { if ( $ value [ 'is_active' ] ) { $ allCampaigns [ $ key ] = Report :: updateTaboolaCampaigns ( $ value [ 'id' ] , $ sendVal ) ; } } } session ( ) -> put ( 'all_cmp_ads_list' , $ allCampaigns ) ; return view ( 'admin.campaign.index' , [ 'title' => __ ( 'globals.campaigns.campaign_management' ) , 'allCampaigns' => $ allCampaigns ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$allCampaigns = Report::getTaboolaAllCampaign()['results'] ?? []; ////////////// All Campaign Puase Balance < 100 Beta ////////////////////////////////// /////////////////////////////////////////////////////////////////////////////