@extends('layouts.master') @section('title',__('All Movies')) @section('breadcum') @endsection @section('maincontent')
{{ __('All Movie') }}
@can('movies.delete') @endcan @if (Session::has('changed_language')) {{ __('Translate All To') }} {{Session::get('changed_language')}} @endif @can('movies.create') {{ __('Add Movie') }} @endcan {{-- Bulk Delete Model Start --}} {{-- Bulk Delete Model End --}} {{-- Impport Model Start --}} {{-- Import Model End --}}
@if(isset($movies) && count($movies) > 0) @foreach($movies as $item) @php if($item->thumbnail != NULL){ $content = @file_get_contents(public_path() .'/images/movies/thumbnails/' . $item->thumbnail); if($content){ $image = public_path() .'/images/movies/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}}
{{__('Year')}}

{{isset($item->publish_year) && $item->publish_year ? $item->publish_year : '-' }}

{{__('Length')}}

{{isset($item->publish_year) && $item->publish_year ? $item->publish_year : '-' }}

{{__('Ratings')}}
@php $rating = ($item->rating)/2; @endphp
@for($rating = 1; $rating <= 5; $rating++) @if($rating<=$item->rating/2) @else @endif @endfor

{{$item->rating}}/10

{{__('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

{{__('Created By')}}
@php $username = App\User::find($item->created_by); @endphp

{{isset($username) && $username != NULL ? $username->name :'user deleted'}}

{{__('Status')}}

@auth @if(Auth::user()->is_assistant == 1) @if($item->status == 1) {{__('Active')}} @else {{__('De Active')}} @endif @else @if($item->status == 1) {{__('Active')}} @else {{__('De Active')}} @endif @endif @endauth

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