diff --git a/CHANGELOG.md b/CHANGELOG.md index 97823f1a..fa09f12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to `sluggable` will be documented in this file. +## 1.1.5 - 2025-09-23 +- **Fix:** Added publishable action stub mapping and template to restore `vendor:publish --tag=actions-stubs` support. +- **Tests:** Added coverage to ensure the action stub publishes successfully. + ## 1.1.4 - 2025-08-26 - **Change:** Dropped support for Laravel 11; package now targets Laravel 12 and newer. - **Change:** Bumped minimum PHP version requirement to 8.4. diff --git a/src/SluggableServiceProvider.php b/src/SluggableServiceProvider.php index 5b07b124..d1f5f822 100644 --- a/src/SluggableServiceProvider.php +++ b/src/SluggableServiceProvider.php @@ -17,6 +17,11 @@ public function boot() $this->publishes([ __DIR__.'/../config/sluggable.php' => config_path('sluggable.php'), ], 'config'); + + // Publish the action stub + $this->publishes([ + __DIR__.'/../stubs/action.stub' => base_path('stubs/action.stub'), + ], 'actions-stubs'); } /** diff --git a/stubs/action.stub b/stubs/action.stub new file mode 100644 index 00000000..32d49ea3 --- /dev/null +++ b/stubs/action.stub @@ -0,0 +1,15 @@ +assertFileExists(config_path('sluggable.php')); }); +it('can publish the action stub', function () { + $stubPath = base_path('stubs/action.stub'); + + if (file_exists($stubPath)) { + unlink($stubPath); + } + + $this->artisan('vendor:publish', [ + '--provider' => 'AesirCloud\Sluggable\SluggableServiceProvider', + '--tag' => 'actions-stubs', + ])->assertExitCode(0); + + $this->assertFileExists($stubPath); +}); + it('merges the configuration file', function () { $config = config('sluggable.source'); expect($config)->toBe('title');