2023-11-17 14:44:01 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
2026-03-15 09:49:11 +08:00
|
|
|
use App\Models\Server;
|
|
|
|
|
use App\Models\ServerRoute;
|
|
|
|
|
use App\Models\Plan;
|
2025-06-22 01:18:38 +08:00
|
|
|
use App\Models\User;
|
2026-03-15 09:49:11 +08:00
|
|
|
use App\Observers\PlanObserver;
|
|
|
|
|
use App\Observers\ServerObserver;
|
|
|
|
|
use App\Observers\ServerRouteObserver;
|
2025-06-22 01:18:38 +08:00
|
|
|
use App\Observers\UserObserver;
|
2023-11-17 14:44:01 +08:00
|
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
2026-03-15 09:49:11 +08:00
|
|
|
use Illuminate\Support\Facades\Event;
|
2023-11-17 14:44:01 +08:00
|
|
|
|
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
2025-05-07 19:48:19 +08:00
|
|
|
* 事件监听器映射
|
|
|
|
|
* @var array<string, array<int, class-string>>
|
2023-11-17 14:44:01 +08:00
|
|
|
*/
|
|
|
|
|
protected $listen = [
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-07 19:48:19 +08:00
|
|
|
* 注册任何事件
|
2023-11-17 14:44:01 +08:00
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
|
|
|
|
parent::boot();
|
|
|
|
|
|
2025-06-22 01:18:38 +08:00
|
|
|
User::observe(UserObserver::class);
|
2026-03-15 09:49:11 +08:00
|
|
|
Plan::observe(PlanObserver::class);
|
|
|
|
|
Server::observe(ServerObserver::class);
|
|
|
|
|
ServerRoute::observe(ServerRouteObserver::class);
|
|
|
|
|
|
|
|
|
|
|
2023-11-17 14:44:01 +08:00
|
|
|
}
|
|
|
|
|
}
|