it is always green, right?
do you mind kindly pointing me in the right direction?
i am asking you to help you, each tr is yellow?
Did anyone have a good example of using charts in laravel 6?
So you say it is still yellow?
you made a css class for each color that change the color, right?
is there another method you think i should be using?
Which other method do you recommend?
$ursb_flag = pending;
$rowclass = ‘yellow’;
if ($ursb_flag !== approved)
{
$ursb_flag = $post->ursb_verify_flag;
if ($rowclass == ‘red’) $rowclass = ‘white’;
else $rowclass = ‘grey’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
Make sure your constants are defined and loaded correctly in the script.
$ursb_flag = pending;
$rowclass = ‘yellow’;
if ($ursb_flag !== approved)
{
$ursb_flag = $post->ursb_verify_flag;
if ($rowclass == ‘red’) $rowclass = ‘white’;
else $rowclass = ‘grey’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
The problem is with your constants.
loaded correctly but the color is not changing its displaying the data but no color change.
@php
$ursb_flag = ‘pending’;
$rowclass = ‘yellow’;
if ($ursb_flag !== ‘approved’)
{
$ursb_flag = $post->ursb_verify_flag;
if ($rowclass == ‘red’) $rowclass = ‘blue’;
else $rowclass = ‘green’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
no sir, if data from db is “approved =green”, if data from db is “pending = yellow”, if data from db “rejected=red”
tr default value is pending = yellow
oh my!!!!do you mind kindly pointing me in the right direction? thank you
yes sir

Why u don’t use a more conventional if?
yes , its what i am trying to do if you look at my code below;
@php
$ursb_flag = ‘pending’;
$rowclass = ‘yellow’;
if ($ursb_flag !== ‘approved’)
{
$ursb_flag = $post->ursb_verify_flag;
if ($ursb_verify_flag == ‘pending’)
$rowclass = ‘blue’;
else $rowclass = ‘green’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
kindly elaborate please
$rowclass = ‘blue’;
else $rowclass = ‘green’;
$rowclass = ‘blue’;
else $rowclass = ‘green’;
@DesolatorMagno thanks for the help; but its not changing color this is the code im running below.
@php
$ursb_flag = ‘pending’;
$rowclass = ‘yellow’;
if ($ursb_flag == ‘pending’)
{
$rowclass = ‘blue’;
}
else {
$rowclass = ‘green’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
no color at all but value is being displayed from db “approved”
https://stackoverflow.com/questions/42284702/laravel-blade-change-row-color-when-variable-value-is-different-in-loop
I have a report page that loops through a collection and displays the data in a generic bootstrap template table – it’s showing data about users, and one user can have multiple rows in the table. I…
noted let me create it and figure out a way
@php
$ursb_flag = ‘pending’;
$rowclass = ‘yellow’;
if ($ursb_flag == ‘pending’)
{
$rowclass = ‘blue’;
}
else {
$rowclass = ‘green’;
}
@endphp
<tr class=”{{ $rowclass }}”>
<td>{{ $post->ursb_verify_flag }}</td>
</tr>
And this is like way overcomplicated, you could simply do.
class=”{{ $post->usrb_verify_flag == ‘pending’ ? ‘blue’ : ‘yellow’ }}”
https://developer.mozilla.org/en-US/docs/Web/Tutorials
https://phptherightway.com/
https://laracasts.com/series/php-for-beginners
https://laracasts.com/series/laravel-6-from-scratch
class=”{{ $post->usrb_verify_flag == ‘pending’ ? ‘blue’ : ‘yellow’ }}”
error
class=”{{ $post->usrb_verify_flag == ‘pending’ ? ‘blue’ : ‘yellow’ }}”
Failed
@php
if ( $post->dbdata == ‘approved’):
$color = ‘green’;
elseif ( $post->dbdata == ‘Pending’):
$color = ‘yellow’;
elseif ( $post->dbdata == ‘rejected’):
$color = ‘red’;
else:
$color = ‘black’;
endif;
@endphp
<tr style=”background-color: {{$color}}”>
<td>
<h6>{{ $post->dbdata }}</h6>
</td>
</tr>
@php
if ( $post->dbdata == ‘approved’):
$color = ‘green’;
elseif ( $post->dbdata == ‘Pending’):
$color = ‘yellow’;
elseif ( $post->dbdata == ‘rejected’):
$color = ‘red’;
else:
$color = ‘black’;
endif;
@endphp
<tr style=”background-color: {{$color}}”>
<td>
<h6>{{ $post->dbdata }}</h6>
</td>
</tr>
thank you @DesolatorMagno for pointing me in the correct direction
i have edited the index.php file to point to my folder, css and images works fine

Who is the ui theme?