31 lines
695 B
PHP
31 lines
695 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Model::shouldBeStrict(! app()->isProduction());
|
|
|
|
Event::listen(['eloquent.created: *', 'eloquent.updated: *', 'eloquent.deleted: *'], function(string $eventName, array $data) {
|
|
storeResourceEvent($eventName, $data, request());
|
|
});
|
|
}
|
|
}
|