Skip to content

Commit

Permalink
Fix compatibility issue with laravel octane (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
milewski authored Oct 3, 2023
1 parent f03ec59 commit d25629a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "MIT",
"require": {
"php": ">=8.1",
"laravel/nova": "^4"
"laravel/nova": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/ResourceNavigationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class ResourceNavigationField extends Panel
{
public ?array $cards = null;

private static ?string $active = null;
public static ?string $active = null;

public function __construct(string $name, array $fields = [])
public function __construct(string $name)
{
$this->name = $name;
}
Expand Down
6 changes: 5 additions & 1 deletion src/ResourceNavigationTabServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ class ResourceNavigationTabServiceProvider extends ServiceProvider
{
public function boot(): void
{
Nova::serving(static function (ServingNova $event): void {
Nova::serving(function (ServingNova $event): void {

Nova::script('resource-navigation-tab', __DIR__ . '/../dist/js/card.js');
Nova::style('resource-navigation-tab', __DIR__ . '/../dist/css/card.css');

});

$this->app->terminating(function () {
ResourceNavigationField::$active = null;
});
}
}

0 comments on commit d25629a

Please sign in to comment.