@extends('layouts.master') @section('title',__('All Audio')) @section('breadcum') @endsection @section('maincontent')
{{ __('All Audio') }}
@can('audio.delete') @endcan @can('audio.create') {{ __('Add Audio') }} @endcan {{-- Bulk Delete Model Start --}} {{-- Bulk Delete Model End --}} {{-- Impport Model Start --}} {{-- Import Model End --}}
@if(isset($audio) && $audio->count() > 0) @foreach($audio as $item) @php if($item->thumbnail != NULL){ $content = @file_get_contents(public_path() .'/images/audio/thumbnails/' . $item->thumbnail); if($content){ $image = public_path() .'/images/audio/thumbnails/' . $item->thumbnail; }else{ $image = Avatar::create($item->title)->toBase64(); } }else{ $image = Avatar::create($item->title)->toBase64(); } $imageData = base64_encode(@file_get_contents($image)); if($imageData){ $src = 'data: '.mime_content_type($image).';base64,'.$imageData; } @endphp
@if($src != NULL) ... @endif
{{$item->title}}

{{__('Genre')}}
@php $genres = collect(); if (isset($item->genre_id)){ $genre_list = explode(',', $item->genre_id); for ($i = 0; $i < count($genre_list); $i++) { try { $genre = App\Genre::find($genre_list[$i])->name; $genres->push($genre); } catch (Exception $e) { } } } @endphp

@if (count($genres) > 0) @for($i = 0; $i < count($genres); $i++) @if($i == count($genres)-1) {{$genres[$i]}} @else {{$genres[$i]}}, @endif @endfor @endif

{{__('Description')}}

{{isset($item->detail) && $item->detail ? str_limit($item->detail,50) : '-' }}

@endforeach
{!! $audio->appends(request()->query())->links() !!}
@else
{{__("Let's start :)")}}
{{__('Get Started by creating a audio! All of your audios will be displayed on this page.')}}
@endif
@endsection @section('script') @endsection