@extends('layouts.main-app') @section('title', 'News') @section('content') @include('components.navbar')
@php $mainImage = $news->images->filter(function ($image) { return $image->image_type === 'featured'; })->first(); @endphp @if ($mainImage) Banner @endif

{{ $news->description}}

{{$news->company_name}} {{ \Carbon\Carbon::parse($news->date_published)->format('F j, Y') }}

@php $mainDescription = $news->descriptions->filter(function ($item) { return $item->description_type === 'main'; })->first(); @endphp @if ($mainDescription) {!! str_replace( ['', '', '', ''], ['', '', '', ''], $mainDescription->description ) !!} @endif

@php $leftImage = $news->images->filter(function ($image) { return $image->image_type === 'left_image'; })->first(); @endphp @if ($leftImage) @endif @php $rightImage = $news->images->filter(function ($image) { return $image->image_type === 'right_image'; })->first(); @endphp @if ($rightImage) @endif
@php $shortDescription = $news->descriptions->filter(function ($item) { return $item->description_type === 'image_description'; })->first(); @endphp @if ($shortDescription) {!! str_replace( ['', '', '', ''], ['', '', '', ''], $shortDescription->description ) !!} @endif
@if($previousNews)

{{ $previousNews->title }}

{{ $previousNews->company_name }} {{ \Carbon\Carbon::parse($previousNews->date_published)->format('F j, Y') }}

@endif @if($nextNews)

{{ $nextNews->title }}

{{ $nextNews->company_name }} {{ \Carbon\Carbon::parse($nextNews->date_published)->format('F j, Y') }}

@endif
@include('components.footer') @endsection