diff --git a/app/View/Components/CardText.php b/app/View/Components/CardText.php index 4729257..7c28d52 100644 --- a/app/View/Components/CardText.php +++ b/app/View/Components/CardText.php @@ -10,14 +10,17 @@ class CardText extends Component { protected Card $card; + protected string $subject; + /** * Create a new component instance. * * @return void */ - public function __construct(Card $card) + public function __construct(Card $card, $subject = '') { $this->card = $card; + $this->subject = strlen($subject) ? $subject : $card->subject; } /** @@ -27,7 +30,7 @@ class CardText extends Component */ public function render() { - $subject = preg_quote(__($this->card->subject)); + $subject = preg_quote(__($this->subject)); // Replace non escaped '?' with subject and also Unescape escaped '?' $text = preg_replace(