Skip to content

Commit

Permalink
Move resource registration to Nova serving (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Bole Chen <[email protected]>
  • Loading branch information
VincentBean and bolechen authored Jan 15, 2025
1 parent 7eb11d2 commit 003d820
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions src/ToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ToolServiceProvider extends ServiceProvider
/**
* Bootstrap any application services.
*/
public function boot()
public function boot(): void
{
$this->publishes([
__DIR__.'/../config/nova-activitylog.php' => config_path('nova-activitylog.php'),
Expand All @@ -37,29 +37,14 @@ public function boot()
config('activitylog.activity_model')::saving(function (Activity $activity) {
$activity->properties = $activity->properties->put('ip', request()->ip());
});

Nova::resources([
config('nova-activitylog.resource'),
]);
$this->routes();
});

Nova::serving(function (ServingNova $event) {
activity()->enableLogging();
});
}

/**
* Register the tool's routes.
*/
protected function routes()
{
}

/**
* Register any application services.
*/
public function register()
{
Nova::resources([
config('nova-activitylog.resource'),
]);
});
}
}

0 comments on commit 003d820

Please sign in to comment.