ImageColumn::make('url') ->width(100) ->height(100) ->label('Image'),TextColumn::make('url') ->formatStateUsing(function ($state) { $currentUrl = request()->getSchemeAndHttpHost(); $downloadLink = "$currentUrl/storage/$state"; return "<a href='$downloadLink' class='danger' download>Download</a>"; }) ->html() ->label('Attachment'),
TextColumn::make('fileable_type') ->sortable() ->searchable() ->label('Resource') ->formatStateUsing(function ($state) { $modelName = explode('\\', $state); return $modelName[count($modelName) - 1]; }),TextColumn::make('fileable_id') ->sortable() ->searchable() ->formatStateUsing(function ($state) { // how can i get `fileable_type` here })
fileable_type
TextColumn::make('post.name') ->sortable() ->searchable(),