Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AppServiceProvider.php 1.8KB

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