Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Hello MisterMike,
I never used replicate, but it seems to me that you have an error.

$oldCourse = Course::with('author')->where('course_id','=',$course_id)->get();

will return a collection of courses, not a signle course. Use this instead.

$oldCourse = Course::with('author')->where('course_id','=',$course_id)->first();

Hope it helps. Gern geschehen!

0

Yes my same conclusion. The replicate method is found on Eloquent Models not Collections

That is your issue.

0

Firtzberg said:

Firtzberg added well.

Last updated 10 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

MisterMike mistermike Joined 20 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.