title: how to change the color of each crud entry when ajax table is enabled?
body: <p>I am using laravel backpack and recently enabled <code>$this-&gt;crud-&gt;enableAjaxTable();</code> in my crud because there was a lot of data to show.</p>
  
  <p>But now I am not able to color my crud entries depending upon a expiry_date as I was doing before by overriding list.blade.php like this:</p>
  
  <pre><code>@if (!$crud-&gt;ajaxTable())
              @foreach ($entries as $k =&gt; $entry)
  
              &lt;?php
              use Carbon\Carbon;
              $today_date = Carbon::now();
  
  
              $data_difference = $today_date-&gt;diffInDays(Carbon::parse($entry-&gt;expiry_date), false);
              if($data_difference &lt;= 7 &amp;&amp; $data_difference &gt;= 0) {
                $color="#FF9900";  
              } elseif($data_difference &lt; 0) {
                $color="#EA2C12";
              } elseif($data_difference &gt; 7) {
                $color="#539E05";
              }
              ?&gt;
  
              &lt;tr data-entry-id="{{ $entry-&gt;getKey() }}" style="color: {{$color}}"&gt;
  </code></pre>
  
  <p>Maybe because of this:</p>
  
  <pre><code>@if (!$crud-&gt;ajaxTable())
  </code></pre>
  
  <p>I tried to customize the <strong>AjaxTable.php</strong> search query using this <a href="https://github.com/Laravel-Backpack/CRUD/issues/101" rel="nofollow noreferrer">link</a> but I was not successful. Here is the code I tried in my ExampleCrudController by overriding search query of ajax:</p>
  
  <pre><code>        public function search()
  {
      $this-&gt;crud-&gt;hasAccessOrFail('list');
  
      // create an array with the names of the searchable columns
      $columns = collect($this-&gt;crud-&gt;columns)
                  -&gt;reject(function ($column, $key) {
                      // the select_multiple, model_function and model_function_attribute columns are not searchable
                      return isset($column['type']) &amp;&amp; ($column['type'] == 'select_multiple' || $column['type'] == 'model_function' || $column['type'] == 'model_function_attribute');
                  })
                  -&gt;pluck('name')
                  // add the primary key, otherwise the buttons won't work
                  -&gt;merge($this-&gt;crud-&gt;model-&gt;getKeyName())
                  -&gt;toArray();
  
      // structure the response in a DataTable-friendly way
      $dataTable = new \LiveControl\EloquentDataTable\DataTable($this-&gt;crud-&gt;query, $columns);
  
      // make the datatable use the column types instead of just echoing the text
      $dataTable-&gt;setFormatRowFunction(function ($entry) {
  
  
          $today_date = Carbon::now();
  
          $data_difference = $today_date-&gt;diffInDays(Carbon::parse($entry-&gt;expiry_date), false);
  
              if($data_difference &lt;= 7 &amp;&amp; $data_difference &gt;= 0) {
                $color="#FF9900";  
              } elseif($data_difference &lt; 0) {
                $color="#EA2C12";
              } elseif($data_difference &gt; 7) {
                $color="#539E05";
              }
  
          // get the actual HTML for each row's cell
          $row_items = $this-&gt;crud-&gt;getRowViews($entry, $this-&gt;crud, $color);
  
          // add the buttons as the last column
          if ($this-&gt;crud-&gt;buttons-&gt;where('stack', 'line')-&gt;count()) {
              $row_items[] = \View::make('crud::inc.button_stack', ['stack' =&gt; 'line'])
                              -&gt;with('crud', $this-&gt;crud)
                              -&gt;with('entry', $entry)
                              -&gt;render();
          }
  
          // add the details_row buttons as the first column
          if ($this-&gt;crud-&gt;details_row) {
              array_unshift($row_items, \View::make('crud::columns.details_row_button')
                              -&gt;with('crud', $this-&gt;crud)
                              -&gt;with('entry', $entry)
                              -&gt;render());
          }
  
          return $row_items;
      });
  
      return $dataTable-&gt;make();
  }
  </code></pre>
  
  <p>So my question is how can I color my crud entries depending upon expiry_date when enableajaxtable is active in laravel backpack?</p>