Ejemplo n.º 1
0
 protected function checkForDuplicate(array $row)
 {
     $quote = Quote::where('quote', $row['quote'])->get();
     if ($quote->count() > 0) {
         Log::notice('Quote already exists.', ['quote' => $row['quote']]);
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $quote = Quote::displayable()->scoreAboveFour()->tweetableLength()->get()->random();
     Twitter::postTweet(['status' => $quote->quote, 'format' => 'json']);
     $this->info('"' . $quote->quote . '"' . ' has been tweeted.');
 }