-2

This is my client admin panel

What i want to do know when the expire month comes that column will become red automatically otherwise it stay green.

1 Answers1

0

in your view

@php
    $currentdate=strtotime(date('Y/m/d'));
    $exp_date=strtotime($expiry_date);

       if($currentdate > $exp_date)
       { //not expired 
         $color="#539E05";
       }
       else
       {
          //expired 
         $color="#EA2C12";
       }
@endphp
  <td style="color: {{$color}}">{{$expiry_date}}</td>

i don't know your html structure looks like so i assumed that expiry date exist in span tag

wahdan
  • 1,208
  • 3
  • 16
  • 26
  • thnq sir its look good but in backpack there is no blade.php file for my clients table there is only dashboard.blade.php & layout.blade.php – Rishabh Mehta Aug 26 '17 at 11:21
  • can you edit your post to provide your controller which set backpack datatable data? so i can edit my answer ? – wahdan Aug 26 '17 at 11:49