dimanche 25 décembre 2016

Obtaining field from table using primary key

Using Laravel and Revisionable Package for tracking changes. In my view I'm populating my table:

@foreach($revisions as $revision)
      @if($revision->key == 'created_at' && !$revision->old_value)
      <tr>
        <td></td>
        <td></td>
        <td width="50"></td>
        <td Width="50"></td>
        <td></td>
        <td></td>
        <td width="150"></td>
      </tr>  
      @else
      <tr>
        <td></td>
        <td></td>
        <td width="50"></td>
        <td width="50"></td>
        <td></td>
        <td></td>
        <td width="150"></td>
      </tr>  
      @endif 
@endforeach

The second column happens to be the primary key of the user record that was modified. I would like to return the email address or first_name/last_name of that users record. I'm fairly new at this and could use a push in the right direction!

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire