I am using laravel 6
and I am currently using the following:
@if($randomNumb<0.5)
// do sth
@endif
My problem with the above code snippet is that I pre-calculate the random number in the backend and then hand it to the blade template. Therefore, I get all the time the same random number, if I am using the above code-snippet more than one time in my blade-template.
Any suggestions how to calculate a unique random number directly in the @if
-directive.
Appreciate your replies!