public function test_it_should_publish_the_config_path() { $this->appMock->shouldReceive('routesAreCached')->andReturn(true); $this->appMock->shouldReceive('call'); $this->sp->boot($this->routerMock); $paths = ServiceProvider::pathsToPublish(RouteBinderServiceProvider::class, 'config'); $this->assertArrayHasKey(dirname(__DIR__) . '/config/routes.php', $paths); $this->assertContains('/config/routes.php', $paths); }
/** * Execute the console command. * * @return void */ public function fire() { $paths = ServiceProvider::pathsToPublish($this->option('provider'), $this->option('tag')); foreach ($paths as $from => $to) { if ($this->files->isFile($from)) { $this->publishFile($from, $to); } elseif ($this->files->isDirectory($from)) { $this->publishDirectory($from, $to); } } $this->info('Publishing Complete!'); }
/** * Execute the console command. * * @return void */ public function fire() { $paths = ServiceProvider::pathsToPublish($this->option('provider'), $this->option('tag')); if (empty($paths)) { return $this->comment("Nothing to publish."); } foreach ($paths as $from => $to) { if ($this->files->isFile($from)) { $this->publishFile($from, $to); } elseif ($this->files->isDirectory($from)) { $this->publishDirectory($from, $to); } else { $this->error("Can't locate path: <{$from}>"); } } $this->info('Publishing Complete!'); }
/** * Publishes the assets for a tag. * * @param string $tag * * @return mixed */ private function publishTag($tag) { $paths = ServiceProvider::pathsToPublish($this->option('provider'), $tag); if (empty($paths)) { return $this->comment("Nothing to publish for tag [{$tag}]."); } foreach ($paths as $from => $to) { if ($this->files->isFile($from)) { $this->publishFile($from, $to); } elseif ($this->files->isDirectory($from)) { $this->publishDirectory($from, $to); } else { $this->error("Can't locate path: <{$from}>"); } } $this->info("Publishing complete for tag [{$tag}]!"); }
protected function handlePublishes() { if ($this->published) { return; } $pathsToPublish = ServiceProvider::pathsToPublish($this->extension->namespace); $this->ensurePathsExistence(array_keys($pathsToPublish)); \Artisan::call('vendor:publish', ['--provider' => $this->extension->namespace]); // Ensure the paths exist $this->waitUntilPathsExist(array_values($pathsToPublish)); $this->published = true; }
public function testPublishedPathsAssets() { $paths = ServiceProvider::pathsToPublish('NewMarket\\Content\\Providers\\ContentServiceProvider', 'assets'); $this->assertTrue(count($paths) > 0); }