Skip to content

Commit

Permalink
use shortnames to publish things
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Mar 10, 2021
1 parent e9f79b6 commit 13f3b0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/PackageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ public function boot()
if ($configFileName = $this->package->configFileName) {
$this->publishes([
$this->package->basePath("/../config/{$configFileName}.php") => config_path("{$configFileName}.php"),
], "{$this->package->name}-config");
], "{$this->package->shortName()}-config");
}

if ($this->package->hasViews) {
$this->publishes([
$this->package->basePath('/../resources/views') => base_path("resources/views/vendor/{$this->package->name}"),
], "{$this->package->name}-views");
], "{$this->package->shortName()}-views");
}

foreach ($this->package->migrationFileNames as $migrationFileName) {
if (! $this->migrationFileExists($migrationFileName)) {
$this->publishes([
$this->package->basePath("/../database/migrations/{$migrationFileName}.php.stub") => database_path('migrations/' . now()->format('Y_m_d_His') . '_' . Str::finish($migrationFileName, '.php')),
], "{$this->package->name}-migrations");
], "{$this->package->shortName()}-migrations");
}
}

if ($this->package->hasTranslations) {
$this->publishes([
$this->package->basePath('/../resources/lang') => resource_path("lang/vendor/{$this->package->shortName()}"),
], "{$this->package->name}-translations");
], "{$this->package->shortName()}-translations");
}

if ($this->package->hasAssets) {
$this->publishes([
$this->package->basePath('/../resources/dist') => public_path("vendor/{$this->package->shortName()}"),
], "{$this->package->name}-assets");
], "{$this->package->shortName()}-assets");
}

$this->commands($this->package->commands);
Expand Down

0 comments on commit 13f3b0f

Please sign in to comment.