@extends('frontend.layouts.app') @section('content')
@foreach($resoures as $rec) @php // Remove HTML tags from the title and then limit the words $cleanedTitle = strip_tags($rec->title); $titleText = $cleanedTitle ? implode(' ', array_slice(explode(' ', $cleanedTitle), 0, 10)) . (str_word_count($cleanedTitle) > 10 ? '...' : '') : ''; // For description, do the same $cleanedDescription = strip_tags($rec->description); $titleDes = $cleanedDescription ? implode(' ', array_slice(explode(' ', $cleanedDescription), 0, 25)) . (str_word_count($cleanedDescription) > 15 ? '...' : '') : ''; @endphp
{{$titleText}}

{{ $titleDes }}

{{ $rec->category->name ?? 'N/A' }}

{{ $rec->course->name ?? 'N/A' }}

{{ $rec->status == 1 ? 'Active' : 'Inactive' }}

Read More
@endforeach
@endsection @push('js') @endpush