Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/flexible-field-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 17 additions & 8 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Check failure on line 18 in src/FieldServiceProvider.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter $event of anonymous function has invalid type Laravel\Nova\Events\ServingNova.

Check failure on line 18 in src/FieldServiceProvider.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter $event of anonymous function has invalid type Laravel\Nova\Events\ServingNova.
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
{
//
}
}
Loading