diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 59d7f207..24dbb3df 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -3,6 +3,7 @@ use Laravel\IoC; use Laravel\Str; use Laravel\Inflector; +use Laravel\Database\Manager as DB; abstract class Model { @@ -148,7 +149,7 @@ abstract class Model { // 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 = IoC::container()->core('database')->connection(static::$connection)->table(static::table($class)); + $model->query = DB::connection(static::$connection)->table(static::table($class)); return $model; } @@ -362,7 +363,7 @@ abstract class Model { // 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 = IoC::container()->core('database')->connection(static::$connection)->table(static::table($model)); + $this->query = DB::connection(static::$connection)->table(static::table($model)); if (property_exists($model, 'timestamps') and $model::$timestamps) { @@ -413,7 +414,7 @@ abstract class Model { $table = static::table(get_class($this)); - return IoC::container()->core('database')->connection(static::$connection)->table($table)->delete($this->id); + return DB::connection(static::$connection)->table($table)->delete($this->id); } /** diff --git a/laravel/validation/validator.php b/laravel/validation/validator.php index 5aac70af..f908974d 100644 --- a/laravel/validation/validator.php +++ b/laravel/validation/validator.php @@ -285,7 +285,7 @@ class Validator { $value = $this->attributes[$attribute]; - $files = IoC::container()->resolve('laravel.input')->files(); + $files = IoC::container()->resolve('laravel.input')->file(); return (array_key_exists($attribute, $files) ? $value['size'] / 1024 : Str::length(trim($value)); } @@ -459,7 +459,7 @@ class Validator { // the default error message for the appropriate units. if (in_array($rule, $this->size_rules) and ! $this->has_rule($attribute, $this->numeric_rules)) { - return (array_key_exists($attribute, IoC::container()->resolve('laravel.input')->files())) + return (array_key_exists($attribute, IoC::container()->resolve('laravel.input')->file())) ? rtrim($message, '.').' '.Lang::line('validation.kilobytes')->get($this->language).'.' : rtrim($message, '.').' '.Lang::line('validation.characters')->get($this->language).'.'; }