vincej
37
30
Laravel

Mailable: Non Numeric Value Encountered

Posted 3 months ago by vincej

I need to pass an alpha-numeric variable $ref into the email I need to send to the customer. This references their quotation data. Example: jac123456-10.

However when it hits the Mail class I get the error. See Here:

class SendCustomerQuote extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct($ref)
    {
        $this->ref = $ref;
    }


    public function build()
    {
        return $this->markdown('emails.customer.customer_quote'/$this->ref);  // HERE IS THE ERROR. 
    }
}

I have read on SO that this is a "feature" of PHP 7.1 & 7.2

So - How do I get around this problem, with out changing all my references to a pure numeric??

Many thanks !

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.