-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminBarPlugin.php
41 lines (32 loc) · 1 KB
/
AdminBarPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Wave\Plugins\AdminBar;
use Livewire\Livewire;
use Wave\Plugins\Plugin;
use Illuminate\Support\Facades\File;
class AdminBarPlugin extends Plugin
{
protected $name = 'Admin Bar';
protected $description = 'An admin bar to quickly jump to documentation and different sections in your app.';
public function register()
{
}
public function boot()
{
if (!app()->runningInConsole() && !app()->environment('testing')) {
$this->app->router->pushMiddlewareToGroup('web', \Wave\Plugins\AdminBar\Http\Middleware\InjectBarMiddleware::class);
}
$this->loadViewsFrom(__DIR__ . '/resources/views', 'admin-bar');
}
public function getPluginInfo(): array
{
return [
'name' => $this->name,
'description' => $this->description,
'version' => $this->getPluginVersion()
];
}
public function getPluginVersion(): array
{
return File::json(__DIR__ . '/version.json');
}
}