Fixing Eloquent constructor bug.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -43,7 +43,7 @@ class Query {
|
||||
{
|
||||
$this->model = ($model instanceof Model) ? $model : new $model;
|
||||
|
||||
$this->table = $this->query();
|
||||
$this->table = $this->table();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +245,7 @@ class Query {
|
||||
*
|
||||
* @return Query
|
||||
*/
|
||||
protected function query()
|
||||
protected function table()
|
||||
{
|
||||
return $this->connection()->table($this->model->table());
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ abstract class Relationship extends Query {
|
||||
// Next we'll set the fluent query builder for the relationship and
|
||||
// constrain the query such that it only returns the models that
|
||||
// are appropriate for the relationship.
|
||||
$this->table = $this->query();
|
||||
$this->table = $this->table();
|
||||
|
||||
$this->constrain();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user