Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app-modules/panel-hub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
composer.lock
32 changes: 32 additions & 0 deletions app-modules/panel-hub/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "he4rt/panel-hub",
"description": "",
"type": "library",
"version": "1.0",
"license": "proprietary",
"require": {
"php": "^8.4",
"filament/filament": "^5.6",
"illuminate/support": "^13.0"
},
"autoload": {
"psr-4": {
"He4rt\\PanelHub\\": "src/",
"He4rt\\PanelHub\\Database\\Factories\\": "database/factories/",
"He4rt\\PanelHub\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"He4rt\\PanelHub\\Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"extra": {
"laravel": {
"providers": [
"He4rt\\PanelHub\\PanelHubServiceProvider"
]
}
}
}
6 changes: 6 additions & 0 deletions app-modules/panel-hub/config/panel-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

declare(strict_types=1);

return [
];
3 changes: 3 additions & 0 deletions app-modules/panel-hub/resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-filament-panels::page>
<div class="text-xl font-bold">Painel do hub</div>
</x-filament-panels::page>
17 changes: 17 additions & 0 deletions app-modules/panel-hub/src/Pages/Dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace He4rt\PanelHub\Pages;

use BackedEnum;
use Filament\Pages\Dashboard as BaseDashboard;

class Dashboard extends BaseDashboard
{
protected static string|null|BackedEnum $navigationIcon = 'heroicon-o-home';

protected static ?string $title = 'Dashboard';

protected string $view = 'panel-hub::dashboard';
}
32 changes: 32 additions & 0 deletions app-modules/panel-hub/src/PanelHubServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace He4rt\PanelHub;

use Filament\Panel;
use Illuminate\Support\ServiceProvider;

class PanelHubServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(function (Panel $panel): void {
if ($panel->getId() !== 'hub') {
return;
}

$panel
->discoverPages(
in: __DIR__.'/../Pages',
for: 'He4rt\\PanelHub\\Pages',
);
});
}

public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'panel-hub');
$this->loadTranslationsFrom(__DIR__.'/../lang', 'panel-hub');
}
}
58 changes: 58 additions & 0 deletions app/Providers/Filament/HubPanelProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

declare(strict_types=1);

namespace App\Providers\Filament;

use App\Filament\Pages\Login;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\AuthenticateSession;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use He4rt\PanelHub\Pages\Dashboard;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;

class HubPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('hub')
->path('hub')
->login(Login::class)
->colors([
'primary' => Color::Purple,
'gray' => Color::Zinc,
])
->viteTheme('resources/css/filament/admin/theme.css')
->sidebarCollapsibleOnDesktop()
->discoverResources(in: app_path('Filament/Hub/Resources'), for: 'App\Filament\Hub\Resources')
->discoverPages(in: app_path('Filament/Hub/Pages'), for: 'App\Filament\Hub\Pages')
->discoverWidgets(in: app_path('Filament/Hub/Widgets'), for: 'App\Filament\Hub\Widgets')
->pages([
Dashboard::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
PreventRequestForgery::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
2 changes: 2 additions & 0 deletions bootstrap/providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Providers\AppServiceProvider;
use App\Providers\EventServiceProvider;
use App\Providers\Filament\AdminPanelProvider;
use App\Providers\Filament\HubPanelProvider;
use App\Providers\FilamentServiceProvider;
use App\Providers\RouteServiceProvider;

Expand All @@ -13,5 +14,6 @@
EventServiceProvider::class,
FilamentServiceProvider::class,
AdminPanelProvider::class,
HubPanelProvider::class,
RouteServiceProvider::class,
];
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"he4rt/integration-twitch": ">=1",
"he4rt/moderation": "^1.0",
"he4rt/panel-admin": ">=1",
"he4rt/panel-hub": ">=1",
"he4rt/portal": ">=1",
"internachi/modular": "^3.0.2",
"laracord/framework": "dev-next",
Expand Down
Loading