PATH:
home
/
lab2454c
/
omvstudio.com
/
resources
/
views
/
admin
/
sport
@extends('admin.layouts.adminMasterLayout') @section('title', 'List Category Movie') @section('movie_management_select','active') @section('content') <div class="container-fluid"> <div class="dashboard__main mb-4"> <h2>Movie List of {{ $category->title }}</h2> </div> <div class="card shadow mb-4"> <div class="card-body"> <div class="float-right"> <a href="{{ route('movie.create') }}" class="btn btn-success mb-4">Add New</a> </div> <div class="table-responsive"> <table class="table table-bordered" id="example" width="100%" cellspacing="0"> <thead> <tr> <th>NAME</th> <th>COVER IMAGE</th> <th>CATEGORIES</th> <th>PRICE</th> <th>DURATION</th> <th>AVG.RATING</th> <th>STATUS</th> <th>ACTION</th> </tr> </thead> <tbody> @if ($movies->count() > 0 ) @foreach ($movies as $movie) @php $movies_reviews = App\Models\Review::where('movie_id',$movie->id)->where('status','active')->orderByDesc('created_at')->get(); $movies_rating_sum = App\Models\Review::where('movie_id',$movie->id)->where('status','active')->sum('rating'); if ($movies_reviews->count() > 0) { //slove error if no review $movies_rating_value = $movies_rating_sum / $movies_reviews->count(); } else{ $movies_rating_value = 0; } $rating_val_num = number_format($movies_rating_value,1); @endphp <tr> <td>{{ $movie->title }}</td> <td> <img src="{{ isset($movie->cover_image) ? asset('storage/movies/'.$movie->cover_image) : asset('admin_assets/images/default-image.png') }}" class="hei-120 wid-120 rounded-circle" alt=""> </td> <td> @foreach ($movie->categories as $category) {{ $category->title }}, @endforeach </td> <td>{{ $movie->price }}</td> <td>{{ $movie->movie_length }}</td> <td> @if ($rating_val_num > 0) <a href="{{ route('rating.review',$movie->id) }}" target="_blank">{{ $rating_val_num }}</a> @endif </td> <td> @if($movie->status=='active') <a href="{{ url('admin/movie/status/inactive/'.$movie->id) }}" class="btn btn-success frm-btn_handler btn__active">Active</a> @else <a href="{{ url('admin/movie/status/active/'.$movie->id) }}" class="btn btn-warning frm-btn_handler btn__deactive">Deactive</a> @endif </td> <td> <a href="{{ route('movie.edit',$movie) }}" class="btn btn-primary frm-btn_handler btn__edit">Edit</a> <form action="{{ route('movie.destroy',$movie->id) }}" method="POST"> {{ csrf_field() }} @method('DELETE') <button class="btn btn-danger frm-btn_handler btn__delete" onclick="return confirm('Are you sure?')">Delete </button> </form> </td> </tr> @endforeach @else <td colspan="7">No data Found!!</td> @endif </tbody> </table> </div> </div> </div> </div> @endsection
[-] form.blade.php
[edit]
[-] create.blade.php
[edit]
[-] edit.blade.php
[edit]
[+]
..
[-] list.blade.php
[edit]
[-] category-movie-list.blade.php
[edit]