Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

AppServiceProvider.php 1.7KB

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