Refactor PagesTable: Removed the featured image column and replaced it with a text column for the title. This change simplifies the table structure and enhances the overall layout by focusing on essential information.
This commit is contained in:
@@ -21,21 +21,6 @@ class PagesTable
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('featured_image')
|
||||
->label(__('pages.table_column_featured_image'))
|
||||
->formatStateUsing(function ($state, $record) {
|
||||
// Eğer featured_image varsa image göster
|
||||
if ($record->featured_image_url) {
|
||||
return '<img src="' . e($record->featured_image_url) . '" alt="" class="w-10 h-10 rounded-full object-cover" />';
|
||||
}
|
||||
|
||||
// Yoksa Heroicon page icon'unu göster (dark mode'da beyaz, light mode'da siyah)
|
||||
$svgIcon = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-10 w-10"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>';
|
||||
|
||||
return '<div class="flex items-center justify-center w-10 h-10 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-950 dark:text-white">' . $svgIcon . '</div>';
|
||||
})
|
||||
->html()
|
||||
->alignCenter(),
|
||||
|
||||
TextColumn::make('title')
|
||||
->label(__('pages.table_column_title'))
|
||||
|
||||
Reference in New Issue
Block a user