コード例 #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;
 }
コード例 #2
0
ファイル: TweetQuote.php プロジェクト: leepownall/stig-quotes
 /**
  * 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.');
 }