Skip to content

Commit 0e34cef

Browse files
committed
wip
1 parent 0be6ae0 commit 0e34cef

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Package.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function name(string $name): self
3131

3232
public function hasConfigFile(string $configFileName = null): self
3333
{
34-
$this->configFileName = $configFileName ?? $this->shortPackageName();
34+
$this->configFileName = $configFileName ?? $this->shortName();
3535

3636
return $this;
3737
}
@@ -101,7 +101,7 @@ public function setBasePath(string $path): self
101101
return $this;
102102
}
103103

104-
public function shortPackageName(): string
104+
public function shortName(): string
105105
{
106106
return Str::after($this->name, 'laravel-');
107107
}

src/PackageServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public function boot()
6363

6464
if ($this->package->hasTranslations) {
6565
$this->publishes([
66-
$this->package->basePath('/../resources/lang') => resource_path("lang/vendor/{$this->package->shortPackageName()}"),
66+
$this->package->basePath('/../resources/lang') => resource_path("lang/vendor/{$this->package->shortName()}"),
6767
], "{$this->package->name}-translations");
6868
}
6969

7070
if ($this->package->hasAssets) {
7171
$this->publishes([
72-
$this->package->basePath('/../resources/dist') => public_path("vendor/{$this->package->shortPackageName()}"),
72+
$this->package->basePath('/../resources/dist') => public_path("vendor/{$this->package->shortName()}"),
7373
], "{$this->package->name}-assets");
7474
}
7575

@@ -79,13 +79,13 @@ public function boot()
7979
if ($this->package->hasTranslations) {
8080
$this->loadTranslationsFrom(
8181
$this->package->basePath('/../resources/lang/'),
82-
$this->package->shortPackageName()
82+
$this->package->shortName()
8383
);
8484
}
8585

8686

8787
if ($this->package->hasViews) {
88-
$this->loadViewsFrom($this->package->basePath('/../resources/views'), $this->package->name);
88+
$this->loadViewsFrom($this->package->basePath('/../resources/views'), $this->package->shortName());
8989
}
9090

9191
$this->packageBooted();

tests/PackageServiceProviderTests/PackageViewsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function configurePackage(Package $package)
1616
/** @test */
1717
public function it_can_load_the_views()
1818
{
19-
$content = view('laravel-package-tools::test')->render();
19+
$content = view('package-tools::test')->render();
2020

2121
$this->assertStringStartsWith('This is a blade view', $content);
2222
}

0 commit comments

Comments
 (0)