app/Http/Controllers/Admin/AdsController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        if((sizeof(session('permissions')) > 0 && session('permissions')['ads_page'] == 0) || session()->get('cur_balance') < 100)
        {
            if(Auth::guard('admin')->user()->id !== 1)
                return abort( 404);
        }
        $res = session()->get('all_cmp_ads_list');
        $id = session()->get('cur_cmpid') ?? '';
        $cmplist = [];
        foreach ($res as $val)
        {
            $cmplist[$val['id']] = $val['id'].' ('.$val['name'].')';
        }
        return view('admin.ads.create', ['title' => __('globals.ads.create_campaign_ads'), 'cmplist' => $cmplist, 'cmpid' => $id]);
    }
public function create ( ) { if ( ( sizeof ( session ( 'permissions' ) ) > 0 && session ( 'permissions' ) [ 'ads_page' ] == 0 ) || session ( ) -> get ( 'cur_balance' ) < 100 ) { if ( Auth :: guard ( 'admin' ) -> user ( ) -> id !== 1 ) return abort ( 404 ) ; } $ res = session ( ) -> get ( 'all_cmp_ads_list' ) ; $ id = session ( ) -> get ( 'cur_cmpid' ) ?? '' ; $ cmplist = [ ] ; foreach ( $ res as $ val ) { $ cmplist [ $ val [ 'id' ] ] = $ val [ 'id' ] . ' (' . $ val [ 'name' ] . ')' ; } return view ( 'admin.ads.create' , [ 'title' => __ ( 'globals.ads.create_campaign_ads' ) , 'cmplist' => $ cmplist , 'cmpid' => $ id ] ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//        if(!isset($res) || $res === null) //            $res = Report::getTaboolaAllCampaign()['results'] ?? [];