@extends('layouts.frontend') @section('title_page', 'All News - Rusizi Veterinary') @section('content') LATEST UPDATES Category : {{ $category }} Home News {{-- Loop through the news items (using $newsItems from the controller) --}} @forelse ($newsItems as $item) {{-- Using the Accessor: $item->imageUrl to get the full path --}} {{-- Updated link to use ID and your route name --}} {{-- Display News Title and link --}} {{ $item->NewsTitle }} {{-- Display Author Name (from user relationship) --}} By {{ $item->user->name ?? 'Admin' }} {{-- Display formatted Date (using the Date attribute which is cast to a date object) --}} On {{ $item->Date->format('F d, Y') }} {{-- Display Category Type --}} In {{ $item->CategoryType ?? 'General' }} {{-- Display a summary of News Details, stripping tags in case it's rich HTML --}} {{ Str::limit(strip_tags($item->NewsDetails), 250) }} Read More @empty No news articles available at the moment. @endforelse {{-- Pagination Links --}} {{ $newsItems->links() }} {{-- Search Form --}} Categories Insemination Vaccination Animal Treatment Animal Insurance Iniative Youth Animal Product Inspection One Health Recent Posts @forelse ($recentNews as $recent) {{ \Carbon\Carbon::parse($recent->Date)->format('F d, Y') }} {{ Str::limit($recent->NewsTitle, 40) }} @empty No recent posts. @endforelse Our Gallery @forelse ($recentImages as $image) 1k 84 @empty No images available. @endforelse View More on Gallery @endsection('content')
{{ Str::limit(strip_tags($item->NewsDetails), 250) }}
No news articles available at the moment.
No recent posts.
No images available.