/** * Set model(s) to use * * @param string|array $models * * @return $this */ public function useModel($models) { if (is_array($models)) { return array_map(array($this, 'useModel'), $models); } if (is_scalar($models)) { $name = strtolower($models); $class = sprintf('\\Lassi\\Model\\%s', ucwords($name)); $this->{$name} = new $class(); $this->{$name}->setConnection($this->lassi->getEloquent()); } return $this; }