News

@foreach($newsArticles as $k => $newsArticle) @php preg_match_all('/<([^>]+)>(?:([^<]+))*(?=[^>]*\<)/',$newsArticle->body,$matches); $strings = array_pop($matches); $shortDescription = ''; foreach ($strings as $string) { $string = trim(str_replace(' ', ' ', $string)); if (strlen($string) != 0){ $shortDescription .= $string; } } @endphp @php($id = Crypt::encrypt($newsArticle->id))
...
{{ ucwords($newsArticle->title) }}

{{ ( strlen($shortDescription) > 80 )? substr($shortDescription, 0, 150).'...': $shortDescription }}

@if(strlen($shortDescription) > 80 ) READ MORE › @endif
@endforeach