jenssegers/Laravel-MongoDB — pull request #50 by DyeH (2013-10-10 17:08:55+00:00)
Title: Nested Getters and Setters

Added capabilities for models to get and set nested attributes using dot notation or camel-case.

```php
$user = User::find($id);

$firstName = $user->nameFirst;
```

The above code would pull attributes from

$model->attributes['name']['first'];

```php
$user->nameFirst = "David";
```

This would set the the attribute

$model->attribute['name']['first']

```
public function setNameFirstAttribute($value)
{
$this->attributes['name']['first'] = $value;
}

public function getNameFirstAttribute($value)
{
return "First name : " . $value;
}

public function getNameAttribute($value)
{
$first = $this->getAttribute("name.first");
$last = $this->getAttribute("name.last");

return $first . ' ' . $last;
}
```
Mutators work using dot notation with the `getAttribute()` and `setAttribute()`