Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 6 months ago.
0

mohammadgholeh said:

Possible helps http://laravel.com/docs/eloquent#mass-assignment

Doesn't seem like he is mass assigning values.

@devmark :

What are you trying to achieve with $from->order = $to->order; ?

Last updated 6 months ago.
0

hello, i wanna change the position.

- id  order
- 1    2
- 2    4
- 3    4
- 4    5
- 5    6

expect after:

- id  order
- 1    2
- 3    4
- 2    5
- 4    6
- 5    7
$form  = id 3
$to = id 2

so first of all, i have to do 'order= order +1' where order >= $to->order then $from->order = $to->order;

Last updated 6 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

devmark devmark Joined 17 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.

© 2022 Laravel.io - All rights reserved.