Beispiel #1
0
 public function getRefreshTweets()
 {
     $tweet = UpcomingTweet::where('end', '<', date('Y-m-d H:i:s'))->first();
     if ($tweet != null) {
         $tweet->delete();
         $newTweet = UpcomingTweet::orderBy('id', 'asc')->first();
         $newTweet->end = date('Y-m-d H:i:s', strtotime('+ 1 hour'));
         $newTweet->save();
     }
     return redirect()->route('admin');
 }
Beispiel #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     \Log::alert('Refresh tweets');
     $tweet = UpcomingTweet::where('end', '<', date('Y-m-d H:i:s'))->first();
     if ($tweet != null) {
         $tweet->delete();
         $newTweet = UpcomingTweet::orderBy('id', 'asc')->first();
         $newTweet->end = date('Y-m-d H:i:s', strtotime('+ 1 hour'));
         $newTweet->save();
     }
 }