app/Http/Controllers/Admin/CampaignController.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')['campaign_management_page'] == 0) || session()->get('cur_balance') < 100)
        {
            if(Auth::guard('admin')->user()->id !== 1)
                return abort( 404);
        }
        $all_sitelist = session()->get('all_sites');
        if(!isset($all_sitelist))
        {
            $all_sitelist = Report::getTaboolaAllSites('2019-01-01', date('Y-m-d'))['results'];
            session()->put('all_sites', $all_sitelist);
        }
        return view('admin.campaign.create', ['title' => __('globals.campaigns.new_campaign'), 'weekdays' => $this->weekdays, 'timezone' => $this->timezone, 'all_sites' => $all_sitelist]);
    }
public function create ( ) { if ( ( sizeof ( session ( 'permissions' ) ) > 0 && session ( 'permissions' ) [ 'campaign_management_page' ] == 0 ) || session ( ) -> get ( 'cur_balance' ) < 100 ) { if ( Auth :: guard ( 'admin' ) -> user ( ) -> id !== 1 ) return abort ( 404 ) ; } $ all_sitelist = session ( ) -> get ( 'all_sites' ) ; if ( ! isset ( $ all_sitelist ) ) { $ all_sitelist = Report :: getTaboolaAllSites ( '2019-01-01' , date ( 'Y-m-d' ) ) [ 'results' ] ; session ( ) -> put ( 'all_sites' , $ all_sitelist ) ; } return view ( 'admin.campaign.create' , [ 'title' => __ ( 'globals.campaigns.new_campaign' ) , 'weekdays' => $ this -> weekdays , 'timezone' => $ this -> timezone , 'all_sites' => $ all_sitelist ] ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .