trigger = $trigger; $this->journal = $journal; } /** * @return bool */ public function triggered() { $search = strtolower($this->trigger->trigger_value); $source = strtolower($this->journal->description); $strpos = strpos($source, $search); if (!($strpos === false)) { // found something Log::debug('"' . $source . '" contains the text "' . $search . '". Return true.'); return true; } // found nothing. Log::debug('"' . $source . '" does not contain the text "' . $search . '". Return false.'); return false; } }