/**
  * Get the path to the file that should be generated.
  *
  * @return string
  */
 protected function getPath()
 {
     return parent::getSrcPath(self::PATH_MIGRATIONS, ucwords($this->argument('name')) . '.php');
 }
Esempio n. 2
0
 public function getPath()
 {
     return parent::getSrcPath(self::PATH_VIEWS, strtolower($this->argument('name')) . '.blade.php');
 }
 /**
  * Get the path to the language templates that contain translations to be added to the
  * corresponding translation file
  *
  * @return string
  */
 protected function getLangFile($group, $locale = null)
 {
     return parent::getSrcPath(self::PATH_LANG, $locale ? $locale . $group . '.php' : '');
 }
Esempio n. 4
0
 /**
  * Get the path to the file that should be generated.
  *
  * @return string
  */
 protected function getPath()
 {
     return parent::getSrcPath(self::PATH_TESTS, studly_case($this->argument('name')) . '.php');
 }
 /**
  * Call generate:views
  *
  * @return void
  */
 protected function generateViews()
 {
     $container = parent::getSrcPath(self::PATH_VIEWS, Pluralizer::plural($this->model));
     $layouts = parent::getSrcPath(self::PATH_VIEWS, 'layouts');
     $adminOnlyView = false;
     if (file_exists($this->getViewTemplatePath('admin'))) {
         // generate only one view for create, edit, show called admin
         $views = array('index', 'admin');
         $adminOnlyView = true;
     } else {
         $views = array('index', 'show', 'create', 'edit');
     }
     $this->generator->folders(array($container));
     // If generating a scaffold, we also need views/layouts/scaffold
     if (!$adminOnlyView && get_called_class() === 'Vsch\\Generators\\Commands\\ScaffoldGeneratorCommand') {
         $views[] = 'scaffold';
         $this->generator->folders($layouts);
     }
     // Let's filter through all of our needed views
     // and create each one.
     foreach ($views as $view) {
         $path = $view === 'scaffold' ? $layouts : $container;
         $this->generateView($view, $path);
     }
 }
Esempio n. 6
0
 /**
  * Get the path to the file that should be generated.
  *
  * @return string
  */
 protected function getPath($name = null)
 {
     return parent::getSrcPath(self::PATH_SEEDS, $name);
 }