Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sarunama's avatar

Enum inside blade wich called by job

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';
}
0 likes
5 replies
sarunama's avatar

PS, in my local development it runs fine.. only in production it is not working

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Are you sure you are running php8.1 in production? You can call phpinfo(); in your code to check in the browser.

sarunama's avatar

Yes its running on 8.1.4 php in production

sarunama's avatar

@sinnbeck

I checked my cron job, it was running on php 8.0, i changed it to 8.1 and now its working. thanks

Please or to participate in this conversation.