您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AppServiceProvider.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Providers;
  3. use App\Http\Responses\LoginRedirectResponse;
  4. use App\Models\Export;
  5. use App\Models\Import;
  6. use App\Models\Notification;
  7. use App\Services\DateRangeService;
  8. use Filament\Actions\Exports\Models\Export as BaseExport;
  9. use Filament\Actions\Imports\Models\Import as BaseImport;
  10. use Filament\Http\Responses\Auth\Contracts\LoginResponse;
  11. use Filament\Notifications\Livewire\Notifications;
  12. use Filament\Support\Assets\Js;
  13. use Filament\Support\Enums\Alignment;
  14. use Filament\Support\Facades\FilamentAsset;
  15. use Illuminate\Notifications\DatabaseNotification;
  16. use Illuminate\Support\ServiceProvider;
  17. class AppServiceProvider extends ServiceProvider
  18. {
  19. /**
  20. * Register any application services.
  21. */
  22. public function register(): void
  23. {
  24. $this->app->singleton(DateRangeService::class);
  25. $this->app->singleton(LoginResponse::class, LoginRedirectResponse::class);
  26. }
  27. /**
  28. * Bootstrap any application services.
  29. */
  30. public function boot(): void
  31. {
  32. // Bind custom Import and Export models
  33. $this->app->bind(BaseImport::class, Import::class);
  34. $this->app->bind(BaseExport::class, Export::class);
  35. // Bind custom Notification model
  36. $this->app->bind(DatabaseNotification::class, Notification::class);
  37. Notifications::alignment(Alignment::Center);
  38. FilamentAsset::register([
  39. Js::make('top-navigation', __DIR__ . '/../../resources/js/top-navigation.js'),
  40. Js::make('history-fix', __DIR__ . '/../../resources/js/history-fix.js'),
  41. Js::make('custom-print', __DIR__ . '/../../resources/js/custom-print.js'),
  42. ]);
  43. }
  44. }