I have article table and it's have type column. I'm trying to get 2 different includes. If type is news get one include if type is quote get another include. But its don't working i'm getting 10 quotes includes then 10 news includes but there must be only 10 news in one page and if i will add quote on web it must have quote include...
Blade:
@if($newsFirstLine->type = 'quotse')
@foreach($newsFirstLine as $quote)
@include("cards/quote", [
'slug' => $quote->getUrl(),
'title' => $quote->tr('title'),
'avatar' => $quote->image,
'created' => $quote->created_at->format('d.m.Y'),
'createdHi' => $quote->created_at->format('H:i'),
])
@endforeach
@endif
@if($newsFirstLine->type = 'news')
@foreach($newsFirstLine as $news_item)
@include("cards/news", [
'image' => $news_item->image,
'slug' => $news_item->getUrl(),
'title' => $news_item->tr('title'),
'created' => $news_item->created_at->format('d.m.Y'),
'createdHi' => $news_item->created_at->format('H:i'),
])
@endforeach
@endif