You're passing a model to find() not an id.
You don't even need the find. Just change $id to movie
public function clone(Movie $movie)
{
$cloneMovie = $movie->replicate();
...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i am trying to clone a movie on MovieShow component im getting this error when i click on the clone button any fix for this
Method Illuminate\Database\Eloquent\Collection::replicate does not exist.
<?php
namespace App\Http\Livewire;
use App\Models\Movie;
use Livewire\Component;
use Carbon\Carbon;
class MovieShow extends Component
{
public $movie;
public $body;
public function mount(Movie $movie)
{
$this->movie = $movie;
}
public function clone(Movie $id)
{
$movie = Movie::find($id);
$cloneMovie = $movie->replicate();
$cloneMovie->cloned_movie_id = $movie->id;
$cloneMovie->updated_at = Carbon::now();
$cloneMovie->created_at = Carbon::now();
$cloneMovie->save();
}
public function render(Movie $movie)
{
$movie->viewcounts();
return view('livewire.movie-show');
}
}
You're passing a model to find() not an id.
You don't even need the find. Just change $id to movie
public function clone(Movie $movie)
{
$cloneMovie = $movie->replicate();
...
Please or to participate in this conversation.