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.

AppServiceProvider.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Providers;
  3. use BezhanSalleh\PanelSwitch\PanelSwitch;
  4. use Filament\Notifications\Livewire\Notifications;
  5. use Filament\Support\Enums\Alignment;
  6. use Illuminate\Support\ServiceProvider;
  7. class AppServiceProvider extends ServiceProvider
  8. {
  9. /**
  10. * Register any application services.
  11. */
  12. public function register(): void
  13. {
  14. //
  15. }
  16. /**
  17. * Bootstrap any application services.
  18. */
  19. public function boot(): void
  20. {
  21. Notifications::alignment(Alignment::Center);
  22. $this->configurePanelSwitch();
  23. }
  24. /**
  25. * Configure the panel switch.
  26. */
  27. protected function configurePanelSwitch(): void
  28. {
  29. PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
  30. $panelSwitch
  31. ->modalHeading('Switch Panel')
  32. ->modalWidth('md')
  33. ->slideOver()
  34. ->excludes(['admin'])
  35. ->iconSize(16)
  36. ->icons(function () {
  37. if (auth()->user()?->belongsToCompany(auth()->user()?->currentCompany)) {
  38. return [
  39. 'user' => 'heroicon-o-user',
  40. 'company' => 'heroicon-o-building-office',
  41. ];
  42. }
  43. return [
  44. 'user' => 'heroicon-o-user',
  45. 'company' => 'icon-building-add',
  46. ];
  47. });
  48. });
  49. }
  50. }