Пример #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $addValue = $this->option('add');
     if ($addValue > 0) {
         $count = Counter::where('name', 'total_views')->first();
         $count->count += $this->option('add');
         $count->save();
         $this->info("Done! Feels good, doesn't it?");
     } else {
         if ($addValue == 0) {
             $this->info("Can't add 0 views...");
         } else {
             $this->info("Can't add negative views... nice try!");
         }
     }
 }
Пример #2
0
 public static function taskDeletesCount()
 {
     return Counter::where('name', 'task_deletes')->first();
 }