@extends('admin.layouts.app') @section('content')

Movies

+ Add Movie
@forelse($movies as $movie) @php $thumbnailUrl = null; $candidates = [ $movie->poster ?? null, $movie->thumbnail ?? null, ]; foreach ($candidates as $path) { if (empty($path)) { continue; } $path = trim($path); if (\Illuminate\Support\Str::startsWith($path, ['http://', 'https://'])) { $thumbnailUrl = $path; break; } if (\Illuminate\Support\Str::startsWith($path, ['uploads/', '/uploads/'])) { $thumbnailUrl = asset(ltrim($path, '/')); break; } if (\Illuminate\Support\Str::startsWith($path, ['storage/', '/storage/'])) { $thumbnailUrl = asset(ltrim($path, '/')); break; } if (\Illuminate\Support\Str::startsWith($path, ['movies/', '/movies/'])) { $thumbnailUrl = asset('storage/' . ltrim($path, '/')); break; } $thumbnailUrl = asset('storage/' . ltrim($path, '/')); break; } @endphp @empty @endforelse
Thumbnail Title Type Genre Status Actions
@if($thumbnailUrl) {{ $movie->title }} @else
No Image
@endif
{{ $movie->title }} {{ $movie->type ?? 'Movie' }} {{ $movie->category ?? 'N/A' }} @if(!empty($movie->is_published)) Published @else Draft @endif
Edit
@csrf @method('DELETE')
@if(!empty($movie->is_published))
@csrf
@else
@csrf
@endif
No movies found.
@if(method_exists($movies, 'links'))
{{ $movies->links() }}
@endif @endsection