/** * Handle the command. * * @param StreamRepositoryInterface $streams * @param TypeRepositoryInterface $types * @param Repository $config */ public function handle(StreamRepositoryInterface $streams, TypeRepositoryInterface $types, Repository $config) { /* @var TypeInterface $type */ $type = $types->find($this->type->getId()); /* @var StreamInterface $stream */ $stream = $type->getEntryStream(); $stream->fill([$config->get('app.fallback_locale') => ['name' => $this->type->getName(), 'description' => $this->type->getDescription()], 'slug' => $this->type->getSlug() . '_posts']); $streams->save($stream); }
/** * Handle the command. * * @param BreadcrumbCollection $breadcrumbs */ public function handle(BreadcrumbCollection $breadcrumbs) { $breadcrumbs->add($this->type->getName(), $this->dispatch(new GetTypePath($this->type))); }
/** * Handle the command. * * @param ViewTemplate $template */ public function handle(ViewTemplate $template) { $template->set('meta_title', $this->type->getName()); }
/** * @param StreamRepositoryInterface $streams * @param Repository $config */ public function handle(StreamRepositoryInterface $streams, Repository $config) { $streams->create([$config->get('app.fallback_locale') => ['name' => $this->type->getName(), 'description' => $this->type->getDescription()], 'namespace' => 'posts', 'slug' => $this->type->getSlug() . '_posts', 'translatable' => true, 'locked' => false]); }