diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 9fd7a148..d9ec2bcc 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -2,7 +2,6 @@ use Laravel\Str; use Laravel\Inflector; -use Laravel\Database\Manager; abstract class Model { @@ -133,7 +132,7 @@ public static function query($class) // Since this method is only used for instantiating models for querying // purposes, we will go ahead and set the Query instance on the model. - $model->query = Manager::connection(static::$connection)->table(static::table($class)); + $model->query = IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table($class)); return $model; } @@ -347,7 +346,7 @@ public function save() // Since the model was instantiated using "new", a query instance has not been set. // Only models being used for querying have their query instances set by default. - $this->query = Manager::connection(static::$connection)->table(static::table($model)); + $this->query = IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table($model)); if (property_exists($model, 'timestamps') and $model::$timestamps) { @@ -396,7 +395,7 @@ public function delete($id = null) // delete statement to the query instance. if ( ! $this->exists) return $this->query->delete(); - return Manager::connection(static::$connection)->table(static::table(get_class($this)))->delete($this->id); + return IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table(get_class($this)))->delete($this->id); } /**