123456789101112131415161718192021222324252627282930313233343536 |
- <?php
-
- namespace App\Filament\Pages;
-
- use Filament\Pages\Page;
- use Illuminate\Support\Facades\Auth;
- use Wallo\FilamentCompanies\FilamentCompanies;
-
- class Employees extends Page
- {
- protected static ?string $navigationIcon = 'heroicon-o-users';
-
- protected static string $view = 'filament.pages.employees';
-
- protected static function shouldRegisterNavigation(): bool
- {
- return Auth::user()->currentCompany->name === 'ERPSAAS';
- }
-
- public function mount(): void
- {
- abort_unless(Auth::user()->currentCompany->name === 'ERPSAAS', 403);
- }
-
- protected function getHeaderWidgets(): array
- {
- return [
- Widgets\Employees::class,
- ];
- }
-
- protected static function getNavigationBadge(): ?string
- {
- return FilamentCompanies::employeeshipModel()::count();
- }
- }
|