Exemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @param  Filesystem  $filesystem
  * @param  Application $application
  * @return string
  */
 public function handle(Filesystem $filesystem, Application $application)
 {
     $destination = $application->getResourcesPath('addons/' . $this->addon->getVendor() . '/' . $this->addon->getSlug() . '-' . $this->addon->getType() . '/views');
     if (is_dir($destination) && !$this->command->option('force')) {
         $this->command->error("{$destination} already exists.");
         return;
     }
     $filesystem->copyDirectory($this->addon->getPath('resources/views'), $destination);
     $this->command->info("Published {$destination}");
 }
 /**
  * Handle the command.
  *
  * @param Parser     $parser
  * @param Filesystem $filesystem
  */
 public function handle(Parser $parser, Filesystem $filesystem)
 {
     $suffix = ucfirst(camel_case($this->slug));
     $entity = str_singular($suffix);
     $class = "{$entity}TableBuilder";
     $namespace = $this->addon->getTransformedClass("{$entity}\\Table");
     $path = $this->addon->getPath("src/{$entity}/Table/{$entity}TableBuilder.php");
     $template = $filesystem->get(base_path("vendor/anomaly/streams-platform/resources/stubs/entity/table/builder.stub"));
     $filesystem->makeDirectory(dirname($path), 0755, true, true);
     $filesystem->put($path, $parser->parse($template, compact('class', 'namespace')));
 }
 /**
  * Handle the command.
  *
  * @param Parser     $parser
  * @param Filesystem $filesystem
  */
 public function handle(Parser $parser, Filesystem $filesystem)
 {
     $suffix = ucfirst(camel_case($this->slug));
     $segment = $this->slug;
     $addon = $this->addon->getSlug();
     $controller = $this->addon->getTransformedClass("Http\\Controller\\Admin\\{$suffix}Controller");
     $path = $this->addon->getPath("resources/routes/{$this->slug}.php");
     $template = $filesystem->get(base_path("vendor/anomaly/streams-platform/resources/stubs/entity/http/routes.stub"));
     $filesystem->makeDirectory(dirname($path), 0755, true, true);
     $filesystem->put($path, $parser->parse($template, compact('addon', 'segment', 'controller')));
 }
 /**
  * Handle the command.
  *
  * @param Parser     $parser
  * @param Filesystem $filesystem
  */
 public function handle(Parser $parser, Filesystem $filesystem)
 {
     $suffix = ucfirst(camel_case($this->slug));
     $entity = str_singular($suffix);
     $class = "{$suffix}Controller";
     $form = "{$entity}FormBuilder";
     $table = "{$entity}TableBuilder";
     $namespace = $this->addon->getTransformedClass("Http\\Controller\\Admin");
     $formBuilder = $this->addon->getTransformedClass("{$entity}\\Form\\{$entity}FormBuilder");
     $tableBuilder = $this->addon->getTransformedClass("{$entity}\\Table\\{$entity}TableBuilder");
     $path = $this->addon->getPath("src/Http/Controller/Admin/{$suffix}Controller.php");
     $template = $filesystem->get(base_path("vendor/anomaly/streams-platform/resources/stubs/entity/http/controller/admin.stub"));
     $filesystem->makeDirectory(dirname($path), 0755, true, true);
     $filesystem->put($path, $parser->parse($template, compact('class', 'namespace', 'formBuilder', 'tableBuilder', 'form', 'table')));
 }
 /**
  * Handle the command.
  *
  * @param Parser     $parser
  * @param Filesystem $filesystem
  */
 public function handle(Parser $parser, Filesystem $filesystem)
 {
     $suffix = ucfirst(camel_case($this->slug));
     $prefix = ucfirst(camel_case($this->namespace));
     $entity = str_singular($suffix);
     $model = "{$entity}Model";
     $class = "{$entity}Repository";
     $implements = "{$entity}RepositoryInterface";
     $namespace = $this->addon->getTransformedClass("{$entity}");
     $interface = $this->addon->getTransformedClass("{$entity}\\Contract\\{$entity}RepositoryInterface");
     $path = $this->addon->getPath("src/{$entity}/{$entity}Repository.php");
     $template = $filesystem->get(base_path("vendor/anomaly/streams-platform/resources/stubs/entity/repository.stub"));
     $filesystem->makeDirectory(dirname($path), 0755, true, true);
     $filesystem->put($path, $parser->parse($template, compact('model', 'class', 'implements', 'namespace', 'interface')));
 }
Exemplo n.º 6
0
 /**
  * Get plugin name for Twig.
  *
  * @return string
  */
 public function getName()
 {
     return isset($this->slug) ? parent::getName() : get_class($this);
 }
Exemplo n.º 7
0
 /**
  * Return the migration's contextual namespace.
  *
  * @return string
  */
 public function contextualNamespace()
 {
     return $this->getNamespace() ?: $this->addon->getSlug();
 }
Exemplo n.º 8
0
 /**
  * Register view overrides.
  *
  * @param AddonServiceProvider $provider
  * @param Addon $addon
  */
 protected function registerOverrides(AddonServiceProvider $provider, Addon $addon)
 {
     $overrides = $provider->getOverrides();
     $mobiles = $provider->getMobile();
     if (!$overrides && !$mobiles) {
         return;
     }
     $this->viewOverrides->put($addon->getNamespace(), $overrides);
     $this->viewMobileOverrides->put($addon->getNamespace(), $mobiles);
 }