'Uptime Monitoring',
'type' => 'placeholder',
'label' => new HtmlString('Uptime Lab extension is now active. You can manage servers in the Uptime Lab admin section.'),
],
];
} catch (\Exception $e) {
return [
[
'name' => 'Uptime Monitoring',
'type' => 'placeholder',
'label' => new HtmlString('Uptime Lab extension is now active. You\'ll need to enable this extension above to get started.'),
],
];
}
}
/**
* Called when the extension is enabled
*/
public function enabled()
{
// Run migrations
Artisan::call('migrate', ['--path' => 'extensions/Others/UptimeLab/database/migrations/2025_01_01_000001_create_ext_uptime_servers_table.php', '--force' => true]);
// Run seeder to populate sample data
try {
Artisan::call('db:seed', ['--class' => 'Paymenter\\Extensions\\Others\\UptimeLab\\Database\\Seeders\\UptimeServerSeeder', '--force' => true]);
} catch (\Exception $e) {
// Seeder might fail if data already exists, which is fine
}
}
/**
* Called when the extension is booted
*/
public function boot()
{
// Register routes
require __DIR__ . '/routes/web.php';
View::addNamespace('uptime-lab', __DIR__ . '/resources/views');
// Register Livewire components
\Livewire\Livewire::component('uptime.index', \Paymenter\Extensions\Others\UptimeLab\Livewire\Uptime\Index::class);
// Add navigation menu item to dashboard - no icon to avoid errors
Event::listen('navigation.dashboard', function () {
return [
'name' => new HtmlString('
Uptime
'),
'route' => 'uptime.index',
'priority' => 32,
'spa' => true,
'params' => [],
'active' => request()->routeIs('uptime.index'),
];
});
// Add admin navigation - no icon to avoid errors
Event::listen('admin.navigation', function () {
return [
'name' => 'Uptime Lab',
'group' => 'Extensions',
'priority' => 10,
];
});
}
}