Illuminate\Support\ServiceProvider::pathsToPublish PHP Method

pathsToPublish() public static method

Get the paths to publish.
public static pathsToPublish ( string $provider = null, string $group = null ) : array
$provider string
$group string
return array
    public static function pathsToPublish($provider = null, $group = null)
    {
        if ($provider && $group) {
            if (empty(static::$publishes[$provider]) || empty(static::$publishGroups[$group])) {
                return [];
            }
            return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]);
        }
        if ($group && array_key_exists($group, static::$publishGroups)) {
            return static::$publishGroups[$group];
        }
        if ($provider && array_key_exists($provider, static::$publishes)) {
            return static::$publishes[$provider];
        }
        if ($group || $provider) {
            return [];
        }
        $paths = [];
        foreach (static::$publishes as $class => $publish) {
            $paths = array_merge($paths, $publish);
        }
        return $paths;
    }

Usage Example

 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);
 }
All Usage Examples Of Illuminate\Support\ServiceProvider::pathsToPublish