some improvements

This commit is contained in:
2025-08-11 21:40:50 +03:00
parent e351803db2
commit 34bcdb062e
12 changed files with 198 additions and 63 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Livewire\MoviePage;
use App\Models\Movie;
use Livewire\Component;
class Collection extends Component
{
public $movie;
public $collection;
public $collectionMovies;
public function render()
{
return view('livewire.movie-page.collection');
}
public function mount()
{
// Get the collection for this movie
$this->collection = $this->movie->collections()->first();
if ($this->collection) {
// Get all movies in this collection
$this->collectionMovies = $this->collection->movies()
->where('movies.id', '!=', $this->movie->id) // Exclude the current movie
->get();
}
}
}