Commit 16575246 authored by Taylor Otwell's avatar Taylor Otwell

bug fixes.

parent dfe3a046
......@@ -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);
}
/**
......
......@@ -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).'.';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment