Hi I am using PHP 7.4 for a laravel application and I am getting this exception very frequently
Unparenthesized a ? b : c ? d : e
is deprecated. Use either (a ? b : c) ? d : e
or a ? b : (c ? d : e)
The code which triggers this exception is :
{{$gigData->three_packages == 1 ? 'checked' : $gigData->packages_details == null ? 'checked' : ''}} onchange="showPackage(this,{{json_encode($customFields->toArray())}})">
I don't know how I can solve it
any opinion???
thank you very much!!
This usage has been deprecated since PHP 7.4: https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.nested-ternary
Either use:
($gigData->three_packages == 1 ? 'checked' : $gigData->packages_details == null) ? 'checked' : ''
Or:
$gigData->three_packages == 1 ? 'checked' : ($gigData->packages_details == null ? 'checked' : '')
Depending on what you want the logic to be.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community