card = $card; $this->subject = strlen($subject) ? $subject : $card->subject; } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|\Closure|string */ public function render() { $subject = preg_quote(__($this->subject)); // Replace non escaped '?' with subject and also Unescape escaped '?' $text = preg_replace( ['/(?$subject", '?'], $this->card->body ); return $text; } }