Skip to content

Commit

Permalink
Upgrade composer and npm
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata committed Jul 20, 2024
1 parent 315f2d8 commit 9d3a5f7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 34 deletions.
53 changes: 37 additions & 16 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

namespace App\Providers\Filament;

use App\Filament\Admin\Pages;
use App\Filament\App\Pages;
use App\Http\Middleware\TeamsPermission;
use App\Listeners\CreatePersonalTeam;
use App\Listeners\SwitchTeam;
use App\Models\Team;
use Filament\Events\Auth\Registered;
use Filament\Events\TenantSet;
use Filament\Facades\Filament;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
Expand All @@ -25,11 +21,9 @@
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\Event;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Laravel\Fortify\Fortify;
use Laravel\Fortify\Http\Controllers\AuthenticatedSessionController;
use Laravel\Fortify\Http\Controllers\RegisteredUserController;
use Laravel\Jetstream\Features;
use Laravel\Jetstream\Jetstream;

Expand All @@ -44,16 +38,20 @@ public function panel(Panel $panel): Panel
->login([AuthenticatedSessionController::class, 'create'])
->passwordReset()
->emailVerification()
->viteTheme('resources/css/Filament/Admin/theme.css')
->viteTheme('resources/css/filament/admin/theme.css')
->colors([
'primary' => Color::Gray,
])
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
->discoverWidgets(in: app_path('Filament/Admin/Widgets/Home'), for: 'App\\Filament\\Admin\\Widgets\\Home')
->widgets([
->pages([
FilamentPage\Dashboard::class,
Pages\EditProfile::class,
// Pages\ApiTokenManagerPage::class,
])->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
// Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
Expand All @@ -68,10 +66,34 @@ public function panel(Panel $panel): Panel
])
->authMiddleware([
Authenticate::class,
])
->plugins([
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
]);
TeamsPermission::class,
]);

// if (Features::hasApiFeatures()) {
// $panel->userMenuItems([
// MenuItem::make()
// ->label('API Tokens')
// ->icon('heroicon-o-key')
// ->url(fn () => $this->shouldRegisterMenuItem()
// ? url(Pages\ApiTokenManagerPage::getUrl())
// : url($panel->getPath())),
// ]);
// }

if (Features::hasTeamFeatures()) {
$panel
->tenant(Team::class, ownershipRelationship: 'team')
->tenantRegistration(Pages\CreateTeam::class)
->tenantProfile(Pages\EditTeam::class)
->userMenuItems([
MenuItem::make()
->label('Team Settings')
->icon('heroicon-o-cog-6-tooth')
->url(fn () => $this->shouldRegisterMenuItem()
? url(Pages\EditTeam::getUrl())
: url($panel->getPath())),
]);
}

return $panel;
}
Expand All @@ -87,7 +109,6 @@ public function boot()
* Disable Jetstream routes.
*/
Jetstream::$registersRoutes = false;

}

public function shouldRegisterMenuItem(): bool
Expand Down
36 changes: 18 additions & 18 deletions app/Providers/Filament/AppPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Navigation\MenuItem;
use Filament\Pages as FilamentPage;
use Filament\Pages\Dashboard;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
Expand All @@ -30,7 +30,6 @@
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Laravel\Fortify\Fortify;
use Laravel\Fortify\Http\Controllers\AuthenticatedSessionController;
use Laravel\Fortify\Http\Controllers\RegisteredUserController;
use Laravel\Jetstream\Features;
use Laravel\Jetstream\Jetstream;

Expand All @@ -43,10 +42,10 @@ public function panel(Panel $panel): Panel
->id('app')
->path('app')
->login([AuthenticatedSessionController::class, 'create'])
->registration([RegisteredUserController::class, 'create'])
->registration()
->passwordReset()
->emailVerification()
->viteTheme('resources/css/Filament/App/admin/theme.css')
->viteTheme('resources/css/filament/admin/theme.css')
->colors([
'primary' => Color::Gray,
])
Expand All @@ -61,12 +60,13 @@ public function panel(Panel $panel): Panel
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
->discoverPages(in: app_path('Filament/App/Pages'), for: 'App\\Filament\\App\\Pages')
->pages([
Dashboard::class,
Pages\EditProfile::class,
])
->discoverWidgets(in: app_path('Filament/App/Widgets/Home'), for: 'App\\Filament\\App\\Widgets\\Home')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
// Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
Expand All @@ -83,20 +83,20 @@ public function panel(Panel $panel): Panel
Authenticate::class,
TeamsPermission::class,
])
->plugins([
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
]);

if (Features::hasApiFeatures()) {
$panel->userMenuItems([
MenuItem::make()
->label('API Tokens')
->icon('heroicon-o-key')
->url(fn () => $this->shouldRegisterMenuItem()
? url(Pages\ApiTokenManagerPage::getUrl())
: url($panel->getPath())),
->plugins([
// \BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
]);
}

// if (Features::hasApiFeatures()) {
// $panel->userMenuItems([
// MenuItem::make()
// ->label('API Tokens')
// ->icon('heroicon-o-key')
// ->url(fn () => $this->shouldRegisterMenuItem()
// ? url(Pages\ApiTokenManagerPage::getUrl())
// : url($panel->getPath())),
// ]);
// }

if (Features::hasTeamFeatures()) {
$panel
Expand Down

0 comments on commit 9d3a5f7

Please sign in to comment.