John Doe

User Profile

Creative Graphic Designer
  • 171Followers
  • 13,725Experience
  • 120Questions
  • Set it as the font John Doe Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fringilla augue nec est tristique auctor. Donec non est at libero vulputate rutrum.

    public function popular($parent = null,$child = null)
      {     
        $products =  Product::with('subcategory')->with('subchild')->paginate(16)->sortByDesc('view_cache');
        return view('Frontend.listing.popular')->with(['products'=>$products]);
       }
       
       
       namespace App\Providers;
    
    use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
    use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
    
    class EventServiceProvider extends ServiceProvider
    {
        /**
         * The event listener mappings for the application.
         *
         * @var array
         */
        protected $listen = [
            'App\Events\SomeEvent' => [
                'App\Listeners\EventListener',
            ],
        ];
    
        /**
         * The subscriber classes to register.
         *
         * @var array
         */
        protected $subscribe = [
            'App\Listeners\UserEventListener',
        ];
    
        /**
         * Register any other events for your application.
         *
         * @param  \Illuminate\Contracts\Events\Dispatcher  $events
         * @return void
         */
        public function boot(DispatcherContract $events)
        {
            parent::boot($events);
        }
    }
    																		 
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fringilla augue nec est tristique auctor. Donec non est at libero vulputate rutrum. Morbi ornare lectus quis justo gravida semper. Nulla tellus mi, vulputate adipiscing cursus eu, suscipit id nulla.

    
    
    																		 
  • John Doe started a new conversation Codeigniter Severity warning2 min ago

    I am trying to use file_get_contents However that gives me error .

    
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: file_get_contents(https://api.telegram.org/bot [number token]/getUpdates):
    
    Filename: controllers/lifeChange.php
    
    
    Line Number: 19
    
    Backtrace:
    
    File: C:\OpenServer\domains\localhost\admin\application\controllers\lifeChange.php
    Line: 19
    Function: file_get_contents
    
    File: C:\OpenServer\domains\localhost\admin\index.php
    Line: 315
    Function: require_once
    																		 
  • John Doe started a new conversation Codeigniter Severity warning2 min ago

    I've created a meta field 'priority_priority' so that I can sort post based on how many times they have been visited..least visited post gets more priority. so whenever a visitor visits the post the priority variable is decremented.but I want priority to be decremented only on the first visit from the same user so am using cookies but the following code in not working the priority is always decremented and

     var_dump($_COOKIE['visitor'.$post_id])
    

    always gives NULL

    $post_id = get_the_ID();
           $priority = get_post_meta($post_id,'priority_priority',true); 
           if($priority>1)
           {     
              if(!isset($_COOKIE['visitor'.$post_id]))
              {        
                   $bool=setcookie('visitor'.$post_id,$post_id,DAY_IN_SECONDS,'/');
                   if(count($_COOKIE) > 0)
                   {
                        $priority = $priority-1;
                        update_post_meta($post_id,'priority_priority',$priority);
                   }
              }
    
           }
     get_header();
     ?>
    
    

    How can i fix it ? Help Needed