public function notify(Authenticatable $user, Invoice $invoice)
    {
        $invoiceData = array_merge([
            'vendor' => 'Vendor',
            'product' => 'Product',
            'vat' => new ViewExpression(nl2br(e($user->extra_billing_info))),
        ], Spark::generateInvoicesWith());

        $data = compact('user', 'invoice', 'invoiceData');

        Mail::send('spark::emails.billing.invoice', $data, function ($message) use ($user, $invoice, $invoiceData) {
            $message->to($user->email, $user->name)
                    ->subject('Your '.$invoiceData['product'].' Invoice')
                    ->attachData($invoice->pdf($invoiceData), 'invoice.pdf');
        });
    }
public function notify(Authenticatable $user, Invoice $invoice)
    {
        $invoiceData = array_merge([
            'vendor' => 'Vendor',
            'product' => 'Product',
            'vat' => new ViewExpression(nl2br(e($user->extra_billing_info))),
        ], Spark::generateInvoicesWith());

        $data = compact('user', 'invoice', 'invoiceData');

        Mail::send('spark::emails.billing.invoice', $data, function ($message) use ($user, $invoice, $invoiceData) {
            $message->to($user->email, $user->name)
                    ->subject('Your '.$invoiceData['product'].' Invoice')
                    ->attachData($invoice->pdf($invoiceData), 'invoice.pdf');
        });
    }
public function notify ( Authenticatable $ user , Invoice $ invoice ) { $ invoiceData = array_merge ( [ 'vendor' => 'Vendor' , 'product' => 'Product' , 'vat' => new ViewExpression ( nl2br ( e ( $ user -> extra_billing_info ) ) ) , ] , Spark :: generateInvoicesWith ( ) ) ; $ data = compact ( 'user' , 'invoice' , 'invoiceData' ) ; Mail :: send ( 'spark::emails.billing.invoice' , $ data , function ( $ message ) use ( $ user , $ invoice , $ invoiceData ) { $ message -> to ( $ user -> email , $ user -> name ) -> subject ( 'Your ' . $ invoiceData [ 'product' ] . ' Invoice' ) -> attachData ( $ invoice -> pdf ( $ invoiceData ) , 'invoice.pdf' ) ; } ) ; }
Notify the given user about a new invoice.

@param  \Illuminate\Contracts\Auth\Authenticatable  $user
@param  \Laravel\Cashier\Invoice  $invoice
@return void
Notify the given user about a new invoice .