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.

DocumentPreview.php 742B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Filament\Infolists\Components;
  3. use App\Enums\Accounting\DocumentType;
  4. use Filament\Infolists\Components\Grid;
  5. class DocumentPreview extends Grid
  6. {
  7. protected string $view = 'filament.infolists.components.document-preview';
  8. protected DocumentType $documentType = DocumentType::Invoice;
  9. protected function setUp(): void
  10. {
  11. parent::setUp();
  12. $this->columnSpan(3);
  13. }
  14. public function type(DocumentType | string $type): static
  15. {
  16. if (is_string($type)) {
  17. $type = DocumentType::from($type);
  18. }
  19. $this->documentType = $type;
  20. return $this;
  21. }
  22. public function getType(): DocumentType
  23. {
  24. return $this->documentType;
  25. }
  26. }