@extends('layouts.front.main') @section('title', __('frontWords.album_single')) @section('content') @if($program->count() > 0) @php $playlist = []; $sharePath =route('program_details',array('slug' => $program->slug)); $shareslug = $program->slug; @endphp;
@php $src = ''; $src = asset('/images/programs/'.$program->image); @endphp

{{ $program->program_name }}

@php $artist_name =[]; if(isset($program->artist_name) && $program->artist_name != null && $program->artist_name != ''){ foreach(json_decode($program->artist_name) as $key => $value){ $artist_name[] = \Modules\Artist\Entities\Artist::find($value)->artist_name ?? ''; } } @endphp

{{ implode(', ',$artist_name) }}

{!! $program->description !!}
{{-- Supporting Video div --}} @if(!empty($program->supporting_video))
@endif
@php $songsList = []; // Use $songs provided by the controller (paginated or collection) @endphp @if(count($songs) > 0) @php $i = 1; // reorder songs newer to older //$songs = $songs->sortByDesc('id'); @endphp @foreach($songs as $song) @php $artist_id = json_decode($song->artist_id); $artist_array = []; foreach($artist_id as $artist){ $artists = Modules\Artist\Entities\Artist::select('artist_name')->where('id',$artist)->first(); if($artists){ $artist_array[] = $artists->artist_name; } } $artist_name = implode(',',$artist_array); // $programPlaylist[] =audioPath($song);// ['title' => $song->audio_title, 'artist' => $artist_name, 'mp3' => audioPath($song)]; // dd($programPlaylist); $playlistItem = [ 'src' => audioPath($song), 'title' => $song->audio_title, 'artist' => $artist_name, 'poster' => $song->image, 'id' => count($playlist)+50, "song_id" => $song->id, 'song_name' => $song->audio_title, "program" =>$song->parent_program->program_name, ]; $songsList[] = [ "songs" => $song, "artist_name" => $artist_name, 'id'=>$playlistItem['id'] ]; $playlist[] = $playlistItem @endphp @endforeach @endif @include('front.components.playlist_component') @if(isset($songs) && is_object($songs) && method_exists($songs,'links'))
{!! $songs->links() !!}
@endif
@endif

Newly Released Programs

@php $newplaylist = []; $i=0; @endphp @if($recent_programs->count() > 0) @foreach($recent_programs as $list) @php $src = ''; $src = asset('/images/programs/'.$list->image); $audios = ''; $songs = ''; $audios = $list->song_list ? json_decode($list->song_list) : []; // dd($live); if(!isset($audios[0])){ continue; } $songs = Modules\Audio\Entities\Audio::find($audios[0]); if(!$songs){ continue; } $newplaylistItem = [ 'src' => audioPath($songs), 'title' => $songs->audio_title, 'artist' =>"", 'poster' => $songs->image, 'id' => count($newplaylist)+20, "song_id" => $songs->id, 'song_name' => $songs->audio_title, "program" =>$songs->parent_program->program_name, ]; $newplaylist[] =$newplaylistItem; @endphp @endforeach @endif
@endsection @php $jsonPlaylist = json_encode($playlist,JSON_HEX_APOS); //dd($jsonPlaylist) @endphp @section('script') @endsection