Ejemplo n.º 1
0
 /**
  * Execute the console command.
  *
  * @param StreamRepositoryInterface $streams
  */
 public function fire(StreamRepositoryInterface $streams)
 {
     /* @var StreamInterface $stream */
     foreach ($streams->all() as $stream) {
         if ($streams->save($stream)) {
             $this->info($stream->getEntryModelName() . ' compiled successfully.');
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }