class Reviews extends Model
{
protected $timestamp = false;
public function user() {
return $this->hasOne('Users', 'id', 'user');
}
}
@foreach($reviews as $review)
<div class="card">
{{$review->user->firstName}}
{{$review->text}}
</div>
@endforeach
public function user() {
return $this->hasOne('App\User', 'id', 'user_id');
}
public function user() {
return $this->belongsTo('App\User', 'user_id', 'id');
}