mirror of
https://github.com/zoe-may/TDoG-Skin.git
synced 2024-11-24 05:42:19 +08:00
23 lines
594 B
PHP
Executable File
23 lines
594 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Listeners;
|
|
|
|
use App\Models\User;
|
|
use Event;
|
|
|
|
class NotifyFailedPlugin
|
|
{
|
|
public function handle($event)
|
|
{
|
|
$plugin = $event->plugin;
|
|
Event::listen(\App\Events\RenderingFooter::class, function ($event) use ($plugin) {
|
|
/** @var User */
|
|
$user = auth()->user();
|
|
if ($user && $user->isAdmin()) {
|
|
$message = trans('errors.plugins.boot', ['plugin' => trans($plugin->title)]);
|
|
$event->addContent("<script>blessing.notify.toast.error('$message')</script>");
|
|
}
|
|
});
|
|
}
|
|
}
|