Publish the assets for a given package name.

@param  string  $package
@return void
334105
protected function publishAssets($package)
    {
        if (! $this->dispatcher->hasNamespace($package)) {
            return $this->error('Package does not exist.');
        }

        if ( ! is_null($path = $this->getPath())) {
            $this->publisher->publish($package, $path);
        } else {
            $path = $this->dispatcher->getPackagePath($package);

            $this->publisher->publishPackage($package, $path);
        }

        $this->output->writeln('<info>Assets published for package:</info> ' .$package);
    }
26476
public function fullBoot($package, $dir)
    {
        $this->mapRoutes($dir);


       if (file_exists($dir.'/views')) {
            $this->loadViewsFrom($dir.'/views', $package);
        }

        if (file_exists($dir.'/migrations')) {
            $this->publishes([
                $dir.'/migrations' => base_path('database/migrations/')
            ], 'migrations');
        }

        if (file_exists($dir.'/seeds')) {
            $this->publishes([
                $dir.'/seeds' => base_path('database/seeds/')
            ], 'seeds');
        }

        if (file_exists($dir."config/$package.php")) {
                $this->mergeConfigFrom(
                    $dir."config/$package.php",
                    $package
             );

                $this->publishes([
                     $dir.'/config' => base_path('config')
                    ], 'config');
        }

        if (file_exists($dir.'/lang')) {

            $this->publishes([
                $dir.'/lang' => resource_path()."/lang/vendor/$package",
            ]);

            $this->loadTranslationsFrom(
                $dir."/lang",
                $package
             );
        }


        if (file_exists($dir.'/assets')) {
            $this->publishes([
                $dir.'/assets' => base_path('resources/assets'),
            ], 'assets');
        }


        if(file_exists($dir.'/factories/ModelFactory.php')){
            require($dir.'/factories/ModelFactory.php');
        }

    }
614106
protected function registerPackageAssets($package, $namespace, $path)
    {
        $assets = dirname($path) .DS .'assets';

        if ($this->app['files']->isDirectory($assets)) {
            list ($vendor) = explode('/', $package);

            $namespace = Str::snake($vendor, '-') .'/' .str_replace('_', '-', $namespace);

            $this->app['assets.dispatcher']->package($package, $assets, $namespace);
        }
    }
1300098
private function publish_packages($packages)
    {
        if (empty($packages)) {
            return;
        }

        foreach ($packages as $package => $directories_to_publish) {
            if (empty($directories_to_publish)) {
                $this->output->writeln("<comment>$package has no files to publish!</comment>");
                continue;
            }

            $this->publish_directories($directories_to_publish);
        }
    }
307369
public function add (Asset $asset) : void
    {
        $this->assets[$asset->getAssetPath()] = $asset;
        $this->setAssets($this->assets);
    }
739033
public function setPackage($package)
    {
        if ($package === $this->package) {
            return;
        }

        $this->package = $package;
        $this->packageOverridden = false;
    }
1218339
public function updateEntry($package)
	{
		$this->verifyCommand($package);

		$lines = file($this->less);

		// Set the new colors
		$lines[0] = '@bg:                ' . $package['bg'] . ";\n";
		$lines[1] = '@gray:              ' . $package['gray'] . ";\n";
		$lines[2] = '@brand-primary:     ' . $package['primary'] . ";\n";
		$lines[3] = '@brand-info:        ' . $package['info'] . ";\n";
		$lines[4] = '@brand-success:     ' . $package['success'] . ";\n";
		$lines[5] = '@brand-warning:     ' . $package['warning'] . ";\n";
		$lines[6] = '@brand-danger:      ' . $package['danger'] . ";\n";
		$lines[7] = '@menuColor:         ' . $package['menu'] . ";\n";

		$this->file->delete($this->less);
		$this->file->put($this->less, implode($lines));
	}
1088208
protected function define(PackageDefinition $package)
    {
        $package->name('blog');

        $package->metadata([
            'icon' => 'rss',
        ]);

        $package->modules([
            'categories' => BlogCategoryModule::class,
            'authors'    => BlogAuthorModule::class,
            'articles'   => BlogArticleModule::class,
        ]);
    }
252607
protected function publishViews($load = true)
    {
        if (is_dir($path = ($this->getBasePath() . '/resources/views'))) {
            $this->publishes([
                $path => base_path("resources/views/vendor/{$this->package}"),
            ], 'views');

            if ($load) $this->loadViews();
        }
    }
708698
public function publish($name)
    {
        if ($name instanceof Component) {
            $component = $name;
        } else {
            $component = $this->laravel['components']->findOrFail($name);
        }

        with(new AssetPublisher($component))
            ->setRepository($this->laravel['components'])
            ->setConsole($this)
            ->publish();

        $this->line("<info>Published</info>: {$component->getStudlyName()}");
    }
839947
protected function installAssets(PackageInterface $package)
    {
        $assets = $this->getPackageAssetsDir($package);
        if (!$assets) {
            return;
        }

        $from = $this->getPackageBasePath($package) . '/' . $assets;
        $target = $this->getAssetsInstallPath($package);
        if (file_exists($from)) {
            $this->io->write(
                sprintf('  - Installing <info>%s</info> assets to <info>%s</info>',
                    $package->getPrettyName(),
                    str_replace(dirname($this->assets_dir) . '/', '', $target)
                )
            );
            $this->filesystem->copy($from, $target);
            Dispatch::registerPackage($package, $target, $this);
            $this->io->write('');
        } else {
            Error::thrower(
                sprintf('Unable to find assets in package "%s"', $package->getPrettyName()),
                '\InvalidArgumentException', __CLASS__, __METHOD__, __LINE__
            );
        }
    }
346122
public function install(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package) {
		parent::install($repo, $package);
		
		$this->removeResources($package);
		$this->installResources($package);
		
	}
522897
protected function writeComposerFile(Package $package, $directory, $plain)
	{
		$stub = $this->getComposerStub($plain);

		$stub = $this->formatPackageStub($package, $stub);

		$this->files->put($directory.'/composer.json', $stub);
	}
1228403
public function replacePackage($package)
    {
        if (! empty($package->dependencies)) {
            foreach ($package->dependencies as $dependency) {
                $this->replacePackage($dependency);
            }
        }

        $this->replacer->replacePackage($package);
    }
71648
public function removePackage($package)
    {
        $config = $this->getContent();
        if (isset($config['require'][$package])) {
            unset($config['require'][$package]);
            $this->setContent($config);
        }
    }
924004
public function install($package)
    {
        if (! is_null($package)) {
            $package = '"'.$package.'"';
        }
        $process = $this->getProcess();
        $process->setCommandLine(trim($this->findComposer().' require '.$package));
        $process->run($this->output);
    }
901802
static function appendLicence( $package )
    {
        $package->appendDocument( 'LICENCE', false, false, false, true,
                                  "This file is part of the package " . $package->attribute( 'name' ) . ".\n" .
                                  "\n" .
                                  "This package is free software; you can redistribute it and/or modify\n" .
                                  "it under the terms of the GNU General Public License as published by\n" .
                                  "the Free Software Foundation; either version 2 of the License, or\n" .
                                  "(at your option) any later version.\n" .
                                  "\n" .
                                  "This package is distributed in the hope that it will be useful,\n" .
                                  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" .
                                  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" .
                                  "GNU General Public License for more details.\n" .
                                  "\n" .
                                  "You should have received a copy of the GNU General Public License\n" .
                                  "along with this package; if not, write to the Free Software\n" .
                                  "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n" );
    }