Example #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $now = Carbon::now();
     foreach (Token::all() as $token) {
         $date = Carbon::parse($token->expiry_date);
         if ($now->timestamp >= $date->timestamp) {
             Token::destroy($token->id);
         }
     }
 }