laravel/framework — pull request #1101 by stephenfrank (2013-04-28 22:27:11+00:00)
Title: [Proposal] Implement save() method on the BelongsTo relationship

I feel it would be reasonable to have a method to persist the relationship from the side of the BelongsTo relationship. I do know that this is available through the side of `HasOneOrMany::save()` however this limits one from persisting a mixed batch of models against another mixed batch (one would be forced to juggle `instanceof` statements to sniff which type of relationship was being given). A generic API for persisting a hasMany/belongsTo relationship seems like something Eloquent should support.

Example:

```php
class Country {
public function users()
{
return $this->hasMany('User');
}
}

class User {
public function country()
{
return $this->belongsTo('Country');
}
}

$user = User::find(123);
$country = Country::find(1);

// HasMany::save(Model $model)
$country->users()->save($user);

// BelongsTo::save(Model $model)
$user->country()->save($country);
```