Exemplo n.º 1
0
 /**
  * Prepares user input options to be passed to migrator and modeler instances.
  *
  * @return void
  */
 protected function prepareOptions()
 {
     $options = $this->getOptions();
     $input = [];
     foreach ($options as $option) {
         $input[] = $this->option($option[0]);
     }
     $lastnsdelim = strrpos($input[1], '\\');
     $this->options[$options[0][0]] = $input[0] ?: rtrim($this->getAppNamespace(), '\\');
     $this->options[$options[1][0]] = substr($input[1], $lastnsdelim);
     $this->options[$options[2][0]] = $input[2] ?: ExtStr::tableize($input[1]);
     $this->options[$options[3][0]] = $input[3] ?: $this->options[$options[1][0]] . 'Closure';
     $this->options[$options[4][0]] = $input[4] ?: ExtStr::tableize($input[1] . 'Closure');
     $this->options[$options[5][0]] = $input[5] ? $input[5] : './app';
     $this->options[$options[6][0]] = $input[6] ? $input[6] : './database/migrations';
     $this->options[$options[7][0]] = $input[7] ?: false;
 }
Exemplo n.º 2
0
 /**
  * Constructs migration class name from the migration name.
  *
  * @param $name
  * @return string
  */
 protected function getClassName($name)
 {
     return ExtStr::classify($this->getName($name));
 }
Exemplo n.º 3
0
 /**
  * Constructs path to a model.
  *
  * @param $name
  * @param $path
  * @return string
  */
 protected function getPath($name, $path)
 {
     return $path . '/' . ExtStr::classify($name) . '.php';
 }