This repository has been archived on 2024-05-20. You can view files and clone it, but cannot push or open issues or pull requests.
PriceyBotPanel/app/Providers/AppServiceProvider.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());
});
}
}