Fix warning message ViewColumn

Tables\Columns\ViewColumn::make('status')
->view('filament.resources.itrf.components.stage-status-badge'),
Tables\Columns\ViewColumn::make('status')
->view('filament.resources.itrf.components.stage-status-badge'),
warning message: "Argument '1' passed to view() is expected to be of type Filament\Support\Components\view-string|null, string givenPHP(PHP0406)" I am wondering, if I could fix/resolve the warning message if its possible. What are the options other than creating a custom column?
2 Replies
toeknee
toeknee3d ago
Try:
Tables\Columns\ViewColumn::make('status')
->view(fn(): View => view('filament.resources.itrf.components.stage-status-badge')),
Tables\Columns\ViewColumn::make('status')
->view(fn(): View => view('filament.resources.itrf.components.stage-status-badge')),
Rolland
RollandOP3d ago
i got this error:
Filament\Support\Components\ViewComponent::view(): Argument #1 ($view) must be of type ?string, Closure given, called in C:\laragon\www\ewpms\app\Filament\Resources\Inventories\Itrf\ItrfResource.php on line 313
Filament\Support\Components\ViewComponent::view(): Argument #1 ($view) must be of type ?string, Closure given, called in C:\laragon\www\ewpms\app\Filament\Resources\Inventories\Itrf\ItrfResource.php on line 313
For context, I am referring the View to this "use Illuminate\Support\Facades\View;"
Want results from more Discord servers?
Add your server