taqi
taqi
FFilament
Created by taqi on 8/2/2024 in #❓┊help
422 (Unprocessable Content)
No description
3 replies
FFilament
Created by taqi on 2/4/2024 in #❓┊help
Solutions to Repetitive Code
TextEntry::make('email')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
TextEntry::make('phone')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
TextEntry::make('address')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
TextEntry::make('email')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
TextEntry::make('phone')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
TextEntry::make('address')
->formatStateUsing(fn(string $state): string => $this->hasAccess ? $state : __('Denied'))
->badge(fn() => !$this->hasAccess)
->icon(fn() => !$this->hasAcecss ? 'heroicon-o-lock-closed' : ''),
See how many times the common function repeats. Is there a more concise and maintainable way to achieve this functionality without repeating or writing a bunch of code? I appreciate any examples or suggestions
8 replies
FFilament
Created by taqi on 2/4/2024 in #❓┊help
Table Filter as Sidebar
No description
4 replies