My guess is wrong php version. What is the php version on the server? You need at least 8.1 (first class callable support) https://www.php.net/manual/en/functions.first_class_callable_syntax.php
Aug 1, 2022
6
Level 2
Syntax error, unexpected token ")" when sending mail in laravel 8
I know the title seems familiar but hear me out...
My code works locally when I try to send out an invoice via email and the email gets sent. However, I deployed the same code to production on ec2 and got this error; https://i.stack.imgur.com/wQS48.jpg
my controller code looks like this...
public function invoice_send(Request $request, Invoice $invoice)
{
Mail::to($request->to)->queue(new NewInvoice($invoice, $request));
return redirect()->route('invoice.show', $invoice);
}
The vendor folder is the only thing that is different between production and development servers so I deleted the vendor and ran composer install again but that didn't solve anything.
Any ideas?
Level 102
Please or to participate in this conversation.