-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Sometimes we want to attach or detach a related model without database update like in this typical example :
public function update($id)
{
$user = User::find($id);
$user->fill(Input::get());
$user->addresses()->destroy(Input::get('addresses_to_destroy'));
$user->addresses()->createMany(Input::get('new_addresses'));
$user->save();
}
For now, all the methods of EmbedsMany make the changes persistent. Couldn't we have methods for the same operations without database update ?
In order to not create dozens of methods with confusing names, what do you think about changing attach
and detach
methods to let them doing same operations that save
and destroy
but without persistence ? An other one could be fine for creating related object from attributes, what do you think about build
?
I'm available for quick implementation.
Metadata
Metadata
Assignees
Labels
No labels