diff --git a/CHANGELOG.md b/CHANGELOG.md index 9187cdf..ea8dab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to `nova-dependency-container` will be documented in this file. +## [1.0.10] - 2025-11-25 + +### Fixed +- Fixed FieldServiceProvider not correctly registering JavaScript assets with Nova +- The previous `$app->resolving()` pattern was not working; switched to standard `Nova::serving()` pattern + +### Changed +- Refactored FieldServiceProvider to use the standard Nova asset registration pattern +- Now properly imports `Laravel\Nova\Events\ServingNova` and `Laravel\Nova\Nova` + +### Technical +- This was the root cause of the Flexible field issue - the Vue components were never being loaded + ## [1.0.9] - 2025-11-25 ### Added diff --git a/composer.json b/composer.json index bdd4e6c..c126284 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "iamgerwin/nova-dependency-container", - "version": "1.0.9", + "version": "1.0.10", "description": "A Laravel Nova 4 and 5 field container allowing to depend on other fields values", "keywords": [ "laravel", diff --git a/docs/flexible-field-support.md b/docs/flexible-field-support.md index 6fe6c10..20aa240 100644 --- a/docs/flexible-field-support.md +++ b/docs/flexible-field-support.md @@ -168,6 +168,7 @@ This ensures that changing a field in Overlay Item #1 doesn't affect the depende ## Version History +- **1.0.10**: Fixed FieldServiceProvider not registering assets with Nova - **1.0.9**: Added debug logging to diagnose Flexible field issues - **1.0.8**: Fixed missing compiled assets in package distribution - **1.0.7**: Fixed multi-group context contamination with 4-method detection approach diff --git a/src/FieldServiceProvider.php b/src/FieldServiceProvider.php index 9379261..703f6f2 100644 --- a/src/FieldServiceProvider.php +++ b/src/FieldServiceProvider.php @@ -5,18 +5,27 @@ namespace Iamgerwin\NovaDependencyContainer; use Illuminate\Support\ServiceProvider; +use Laravel\Nova\Events\ServingNova; +use Laravel\Nova\Nova; class FieldServiceProvider extends ServiceProvider { + /** + * Bootstrap any application services. + */ public function boot(): void { - if (class_exists('Laravel\Nova\Nova')) { - $this->app->resolving('Laravel\Nova\Nova', function ($nova): void { - \Laravel\Nova\Nova::serving(function ($event): void { - \Laravel\Nova\Nova::script('nova-dependency-container', __DIR__ . '/../dist/js/field.js'); - \Laravel\Nova\Nova::style('nova-dependency-container', __DIR__ . '/../dist/css/field.css'); - }); - }); - } + Nova::serving(function (ServingNova $event): void { + Nova::script('nova-dependency-container', __DIR__ . '/../dist/js/field.js'); + Nova::style('nova-dependency-container', __DIR__ . '/../dist/css/field.css'); + }); + } + + /** + * Register any application services. + */ + public function register(): void + { + // } }