Illuminate\Support\Collection::merge PHP Method

merge() public method

Merge the collection with the given items.
public merge ( mixed $items ) : static
$items mixed
return static
    public function merge($items)
    {
        return new static(array_merge($this->items, $this->getArrayableItems($items)));
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param \Notadd\Foundation\Extension\ExtensionManager $manager
  */
 public function boot(ExtensionManager $manager)
 {
     if ($this->app->isInstalled()) {
         $manager->getExtensions()->each(function (Extension $extension) use($manager) {
             $registrar = $extension->getRegistrar();
             static::$complies = static::$complies->merge($registrar->compiles());
             $this->commands($registrar->loadCommands());
             (new Collection($registrar->loadLocalizationsFrom()))->each(function ($path, $namespace) {
                 $this->loadTranslationsFrom($path, $namespace);
             });
             (new Collection($registrar->loadMigrationsFrom()))->each(function ($paths) {
                 $this->loadMigrationsFrom($paths);
             });
             (new Collection($registrar->loadPublishesFrom()))->each(function ($to, $from) {
                 $this->publishes([$from => $to], 'public');
             });
             (new Collection($registrar->loadViewsFrom()))->each(function ($path, $namespace) {
                 $this->loadViewsFrom($path, $namespace);
             });
             $extension->enable();
             $this->app->make(Dispatcher::class)->fire(new ExtensionEnabled($this->app, $manager, $extension));
             $manager->boot($registrar);
         });
     }
     $this->commands([InstallCommand::class, ListCommand::class, UninstallCommand::class, UpdateCommand::class]);
 }
All Usage Examples Of Illuminate\Support\Collection::merge