Support the ongoing development of Laravel.io →
neon5

neon5

Joined 21 Feb 2014

Statistics

Threads 25
Replies 44
Solutions 0
Articles 0

How do I copy a model and its many children efficiently?

Hello, I need to copy a parent model and its children and its children's children. I don't want to d...

Likes Replies

Can't get blade to escape properly

I am using the WYSIWYG editor Summernote but this seems to be an issue with any editor: Let's say I...

Likes Replies

Is this a bug or am I just doing it wrong?

$owner = Owner::with('cars.carParts')->where('id', "=", $ownerID)->first(); $owner-...

Likes Replies

Returning records using withTrashed()

An Owner has many Cars... And in my blade page I have this... {{{$car->Owner->name}}} And tha...

Likes Replies

Stuck on this! How to stop these database hits?

Something was causing multiple calls to the User table. I found the solution on some blog that reco...

Likes Replies
7 years ago

How do I copy a model and its many children efficiently?

jarektkaczyk, Thank you for the code. I got it to work by changing the $parentKeyName line otherwise...

0 Likes
7 years ago

How do I copy a model and its many children efficiently?

I'm still slowly working through this. Current error is: SQLSTATE[42000]: Syntax error or access vi...

0 Likes
7 years ago

How do I copy a model and its many children efficiently?

I use DebugBar to monitor the SQL queries and just discovered that saveMany() does a separate INSERT...

0 Likes
7 years ago

How do I copy a model and its many children efficiently?

My code above worked just by fixing my $parts_array variable just like as jlaswell recommended. All...

0 Likes
7 years ago

How do I copy a model and its many children efficiently?

I'm still stuck on this. This is what I have so far. I get the car and then... $car_copy = $car-&g...

0 Likes

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.