some progress
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CelebrityController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ContactController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Comment;
|
||||
use App\Models\Movie;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -20,6 +21,17 @@ class MovieController extends Controller
|
||||
->where('slug', $slug)
|
||||
->firstOrFail();
|
||||
|
||||
return view('movie.show', compact('movie'));
|
||||
// comments
|
||||
$comments = Comment::where(function($query) use ($movie){
|
||||
$query->where(function($query) use ($movie){
|
||||
$query->where('entity_id', $movie->id)
|
||||
->where('entity_type', Comment::TYPE_MOVIE);
|
||||
})
|
||||
->orWhere('tmdb_id', $movie->tmdb_id);
|
||||
})
|
||||
->paginate(15);
|
||||
|
||||
|
||||
return view('movie.show', compact('movie', 'comments'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\MoviePage;
|
||||
|
||||
use App\Models\Movie;
|
||||
use App\Models\MovieRecommendation;
|
||||
use Livewire\Component;
|
||||
|
||||
class Recommendations extends Component
|
||||
{
|
||||
public $movie;
|
||||
public $recommendations;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.movie-page.recommendations');
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$movie = Movie::find($this->movie->id);
|
||||
|
||||
$this->recommendations = Movie::whereIn('id', MovieRecommendation::where('movie_id', $this->movie->id)->pluck('recommended_movie_id'))->get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\MoviePage;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Similar extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.movie-page.similar');
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,24 @@
|
||||
|
||||
namespace App\Livewire\MoviePage\Tabs;
|
||||
|
||||
use App\Models\Movie;
|
||||
use App\Models\ReleaseDate;
|
||||
use Livewire\Component;
|
||||
|
||||
class Releases extends Component
|
||||
{
|
||||
public $movie;
|
||||
public $releases;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.movie-page.tabs.releases');
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->movie = Movie::with('releaseDates')->where('id', $this->movie->id)->first();
|
||||
|
||||
$this->releases = $this->movie->releaseDates;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<div>
|
||||
<div class="row">
|
||||
@foreach($recommendations as $recommendation)
|
||||
<div class="col-md-1">
|
||||
<a href="{{ route('movie.show', $recommendation->slug) }}">
|
||||
<img
|
||||
src="http://image.tmdb.org/t/p/w185/{{ $recommendation->poster_path }}"
|
||||
alt="{{ $recommendation->title }}"
|
||||
title="{{ $recommendation->title }} ({{ $recommendation->release_date->format('Y') }})"
|
||||
class="img img-fluid"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{-- If you look to others for fulfillment, you will never truly be fulfilled. --}}
|
||||
</div>
|
||||
@@ -4,7 +4,9 @@
|
||||
Studio
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
@foreach($productionCompanies as $productionCompany)
|
||||
<a href="">{{ $productionCompany->name }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +16,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
@foreach($productionCountries as $productionCountry)
|
||||
{{ $productionCountry->name }}
|
||||
<a href="">{{ $productionCountry->name }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,7 +26,7 @@
|
||||
Language
|
||||
</div>
|
||||
<div class="content">
|
||||
{{ $movie->original_language }}
|
||||
<a href="">{{ $movie->original_language }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
<div>
|
||||
{{-- Success is as dangerous as failure. --}}
|
||||
<table class="table table-responsive table-stripped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Certification</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($releases as $release)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $release->iso_3166 }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $release->certification }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -47,10 +47,10 @@
|
||||
<button class="nav-link" id="cast-tab" data-bs-toggle="tab" data-bs-target="#cast-tab-pane" type="button" role="tab" aria-controls="cast-tab-pane" aria-selected="false">Cast</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">Crew</button>
|
||||
<button class="nav-link" id="crew-tab" data-bs-toggle="tab" data-bs-target="#crew-tab-pane" type="button" role="tab" aria-controls="crew-tab-pane" aria-selected="false">Crew</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">Releases</button>
|
||||
<button class="nav-link" id="releases-tab" data-bs-toggle="tab" data-bs-target="#releases-tab-pane" type="button" role="tab" aria-controls="releases-tab-pane" aria-selected="false">Releases</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
@@ -60,10 +60,12 @@
|
||||
<div class="tab-pane fade" id="cast-tab-pane" role="tabpanel" aria-labelledby="cast-tab" tabindex="0">
|
||||
@livewire(App\Livewire\MoviePage\Tabs\Cast::class, ['movie' => $movie])
|
||||
</div>
|
||||
<div class="tab-pane fade" id="contact-tab-pane" role="tabpanel" aria-labelledby="contact-tab" tabindex="0">
|
||||
<div class="tab-pane fade" id="crew-tab-pane" role="tabpanel" aria-labelledby="crew-tab" tabindex="0">
|
||||
@livewire(App\Livewire\MoviePage\Tabs\Crew::class, ['movie' => $movie])
|
||||
</div>
|
||||
<div class="tab-pane fade" id="disabled-tab-pane" role="tabpanel" aria-labelledby="disabled-tab" tabindex="0">...</div>
|
||||
<div class="tab-pane fade" id="releases-tab-pane" role="tabpanel" aria-labelledby="releases-tab" tabindex="0">
|
||||
@livewire(App\Livewire\MoviePage\Tabs\Releases::class, ['movie' => $movie])
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
@@ -76,12 +78,35 @@
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">Recommended</div>
|
||||
<div class="card-body"></div>
|
||||
<div class="card-body">
|
||||
@livewire(App\Livewire\MoviePage\Recommendations::class, ['movie' => $movie])
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">Write review</div>
|
||||
<div class="card-body"></div>
|
||||
</div>
|
||||
@foreach($comments as $comment)
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@if($comment->author_avatar)
|
||||
<img src="http://image.tmdb.org/t/p/w45/{{ $comment->author_avatar }}" alt="" width="25">
|
||||
@endif
|
||||
{{ $comment->author_name }}
|
||||
<span class="rating">
|
||||
{{ $comment->author_rating }}
|
||||
</span>
|
||||
<span class="text-muted float-end">
|
||||
<small>
|
||||
{{ $comment->published_at }}
|
||||
</small>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{!! $comment->content !!}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="card">
|
||||
|
||||
Reference in New Issue
Block a user