32 lines
720 B
PHP
32 lines
720 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(
|
|
events: ['eloquent.created: *', 'eloquent.updated: *', 'eloquent.deleted: *'],
|
|
listener: fn (string $eventName, array $data) => storeResourceEvent($eventName, $data, request())
|
|
);
|
|
}
|
|
}
|