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; }
/** * 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.'); }