Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

DefaultSetting.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Filament\Pages;
  3. use Filament\Pages\Page;
  4. use Illuminate\Support\Facades\Auth;
  5. use Illuminate\Support\Facades\Gate;
  6. use Wallo\FilamentCompanies\FilamentCompanies;
  7. class DefaultSetting extends Page
  8. {
  9. public mixed $company;
  10. protected static ?string $navigationIcon = 'heroicon-o-adjustments';
  11. protected static ?string $navigationLabel = 'Default';
  12. protected static ?string $navigationGroup = 'Settings';
  13. protected static ?string $title = 'Default';
  14. protected static string $view = 'filament.pages.default-setting';
  15. public function mount($company): void
  16. {
  17. $this->company = FilamentCompanies::newCompanyModel()->findOrFail($company);
  18. $this->authorizeAccess();
  19. }
  20. protected function authorizeAccess(): void
  21. {
  22. Gate::authorize('view', $this->company);
  23. }
  24. public static function getSlug(): string
  25. {
  26. return '{company}/settings/default';
  27. }
  28. public static function getUrl(array $parameters = [], bool $isAbsolute = true): string
  29. {
  30. return route(static::getRouteName(), ['company' => Auth::user()->currentCompany], $isAbsolute);
  31. }
  32. protected function getBreadcrumbs(): array
  33. {
  34. return [
  35. 'default' => 'Default',
  36. ];
  37. }
  38. }