mirror of
https://github.com/zoe-may/TDoG-Skin.git
synced 2025-01-19 06:57:24 +08:00
23 lines
594 B
PHP
23 lines
594 B
PHP
|
<?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>");
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|