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.

CustomTextInputColumn.php 864B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Filament\Tables\Columns;
  3. use Closure;
  4. use Filament\Tables\Columns\TextInputColumn;
  5. class CustomTextInputColumn extends TextInputColumn
  6. {
  7. protected string $view = 'filament.tables.columns.custom-text-input-column';
  8. protected bool | Closure $isDeferred = false;
  9. protected bool | Closure $isNavigable = false;
  10. public function deferred(bool | Closure $condition = true): static
  11. {
  12. $this->isDeferred = $condition;
  13. return $this;
  14. }
  15. public function navigable(bool | Closure $condition = true): static
  16. {
  17. $this->isNavigable = $condition;
  18. return $this;
  19. }
  20. public function isDeferred(): bool
  21. {
  22. return (bool) $this->evaluate($this->isDeferred);
  23. }
  24. public function isNavigable(): bool
  25. {
  26. return (bool) $this->evaluate($this->isNavigable);
  27. }
  28. }