Fixing bugs and improving.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -68,6 +68,19 @@ abstract class Relationship extends Query {
|
||||
return strtolower(basename($model).'_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a freshly instantiated instance of the related model class.
|
||||
*
|
||||
* @param array $attributes
|
||||
* @return Model
|
||||
*/
|
||||
protected function fresh_model($attributes = array())
|
||||
{
|
||||
$class = get_class($this->model);
|
||||
|
||||
return new $class($attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the foreign key for the relationship.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user