Level 1
PS, in my local development it runs fine.. only in production it is not working
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
in my controller i call a job:
SendOfferEmail::dispatch($offer, $request->all());
then my job calls a load pdf by Dompdf:
$pdf= PDF::loadView('pages.offers.pdf', [
'offer' => $this->offer,
'rows' => $rows
]);
in my blade i call the enum:
@if ($row->type == \App\Enums\RowType::X->value)
x
@endif
Then the job failed with message:
ParseError: syntax error, unexpected identifier "RowType" in /var/www/vhosts/****/app/Enums/RowType.php:5
my enum php file:
<?php
namespace App\Enums;
enum RowType: string
{
case X = 'x';
case Stuks = 'stuks';
case Post = 'post';
}
Are you sure you are running php8.1 in production? You can call phpinfo(); in your code to check in the browser.
Please or to participate in this conversation.