title: Altering model's columns if another model's column has a certain value
body: <p>So, I have the following code:</p>
  
  <pre><code>$query = Good::query();    
  $query-&gt;with('availabilities_good.availability.truck');
  $rows = $query-&gt;get();
  </code></pre>
  
  <p>I grab the <code>goods</code> from the database along with the <code>availabilities</code> asociated with them through the <code>availabilities_good</code> pivot table.
  Now, <code>availability</code> model has a <code>truck</code> relationship.
  Truck model has the following columns: <code>id</code>, <code>car_plate</code> and <code>vin</code>.
  Is there a way that I can alter the <code>car_plate</code> value on the fly(while eager loading) based on a <code>good</code>'s column value?</p>
  
  <p>Eg.: if the <code>good</code>'s <code>status</code> column has the value <code>active</code> then I want to replace <code>car_plate</code>'s characters with <code>******</code> as in hiding it, otherwise, leave it untouched.</p>
  
  <p>I know I can do this with a <code>foreach</code> loop on the <code>$rows</code> array but I'm asking if there's a way to do this while eager loading.</p>
  
  <p>Thank you.</p>