33 lines
801 B
PHP
33 lines
801 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Spatie\Activitylog\Models\Activity;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
if ($this->app->isLocal()) {
|
|
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
|
|
}
|
|
|
|
// This is so we can access alpine without livewire on the page.
|
|
\Livewire\Livewire::forceAssetInjection();
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Activity::saving(function (Activity $activity) {
|
|
$activity->properties = $activity->properties->put('ip', request()->ip());
|
|
});
|
|
}
|
|
}
|