Шаблон:
<div class="item-wrapper" style="text-align:justify; top: 100px;">
<legend>Reviews</legend>
@if (count($reviews)>0)
@forelse($reviews as $review)
@if( $review->counselor_id == $cprofile->id)
{{$review->review}}
{{$review->rating}}
<star-rating :rating="{{$review->rating}}">
</star-rating>
@endif @empty
@endforelse
@endif
</div>
Контроллер:
$relations = [
'viewCprofile' => counselor::all(),
'reviews' => DB::table('counselor_reviews')
->select('*')
->get()
];
return view('viewCprofile', $relations);
Маршрут:
Route::get('/viewCprofile', 'ProfilesController@getCprofiles');
Должен ли я передавать идентификатор в контроллер для получения данных?