@php $latestmanga = $mangas->take(9); $getId = function ($id,$lang){ return $desired_object = $lang->filter(function ($item) use($id) { return $item->manga_id == $id; }); }; $getScore = function( $id, $section){ return $ratings = DB::table('ratings') ->where('parent_id','=',$id) ->where('section','=',$section) ->select(DB::raw("SUM(star) as score"),DB::raw("COUNT(id) as count")) ->first(); }; //dd($getId(2,$mangas_list)->take(2)); @endphp
@foreach($mangas->chunk(2) as $items)
@foreach($items as $item)

{{$item->m_title}}

@php $tempScore = $getScore($item->id,0); @endphp @if($tempScore->score) @php if($tempScore->count == 0 ){ $scr = 0; } else{ $scr= $tempScore->score/$tempScore->count; } $scr = round($scr * 2)/2; $tempscr = $scr; if(in_array($scr,[0.5,1.5,2.5,3.5,4.5 ])){ $tempscr = $tempscr +1; } @endphp @for($i=1;$i<=$tempscr;$i++) @if($tempscr - $i != 0.5) @else @endif @endfor @for($i=1;$i<=5-$scr;$i++) @endfor {{$scr}} @else 0.0 @endif
@foreach($getId($item->id,$mangas_list)->take(2) as $it)
{{ $it->episode_title }} @php date_default_timezone_set('Asia/Baku'); $starttimestamp = strtotime($it->created_at); $endtimestamp = strtotime(now()); $difference = abs($endtimestamp - $starttimestamp)/3600; @endphp @if(floor($difference) < 24) {{floor($difference)}} saat əvvəl @else {{date_format(date_create($it->created_at),'d-m-Y')}} @endif
@endforeach
@endforeach
@endforeach