You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Employees.php 983B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Filament\Pages;
  3. use Filament\Pages\Page;
  4. use Illuminate\Support\Facades\Auth;
  5. use Wallo\FilamentCompanies\FilamentCompanies;
  6. class Employees extends Page
  7. {
  8. protected static ?string $navigationIcon = 'heroicon-o-users';
  9. protected static string $view = 'filament.pages.employees';
  10. protected static function shouldRegisterNavigation(): bool
  11. {
  12. return Auth::user()->currentCompany->name === 'ERPSAAS';
  13. }
  14. public function mount(): void
  15. {
  16. abort_unless(Auth::user()->currentCompany->name === 'ERPSAAS', 403);
  17. }
  18. protected function getHeaderWidgets(): array
  19. {
  20. return [
  21. Widgets\Employees\Charts\CumulativeRoles::class,
  22. Widgets\Employees\Charts\CumulativeGrowth::class,
  23. Widgets\Employees\Tables\Employees::class,
  24. ];
  25. }
  26. protected static function getNavigationBadge(): ?string
  27. {
  28. return FilamentCompanies::employeeshipModel()::count();
  29. }
  30. }