Skip to content

Commit 9855332

Browse files
fix database media
1 parent 4470dde commit 9855332

File tree

5 files changed

+40
-46
lines changed

5 files changed

+40
-46
lines changed

database/migrations/2025_01_27_143443_create_media_table.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ public function up(): void
1717
$table->uuid()->nullable()->unique();
1818
$table->nullableMorphs('original_model');
1919
$table->string('collection_name');
20-
$table->string('name');
2120
$table->string('file_name');
2221
$table->string('mime_type')->nullable();
23-
$table->string('title')->nullable();
24-
$table->text('description')->nullable();
25-
$table->text('internal_note')->nullable();
26-
$table->string('alt')->nullable();
2722
$table->boolean('write_protected')->default(false);
2823
$table->string('disk');
2924
$table->string('conversions_disk')->nullable();

database/migrations/2025_03_12_093353_change_media_table.php.php

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<span
2+
class="fi-icon-btn relative flex h-8 w-8 items-center justify-center rounded-lg bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"
3+
title="{{ $locale }}">
4+
<img src="https://flagcdn.com/24x18/{{ $countryCode }}.png"
5+
srcset="https://flagcdn.com/48x36/{{ $countryCode }}.png 2x" width="24" height="18" alt="{{ $locale }}"
6+
class="rounded-sm">
7+
</span>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@php
2+
$flags = $getState(); // Example: More than 4 flags
3+
$visibleFlags = array_slice($flags, 0, 3); // Show only the first 4
4+
$remainingFlags = count($flags) - 4; // Count remaining flags
5+
@endphp
6+
<x-filament-forms::field-wrapper>
7+
8+
<div class="flex">
9+
@foreach($visibleFlags as $index => $flag)
10+
@if($flag == 'en')
11+
<div class="relative" style="margin-left: -{{ $index * 4 }}px">
12+
<x-dynamic-component :component="'flag-gb'" class="w-6 h-6 rounded-full" />
13+
</div>
14+
@else
15+
<div class="relative" style="margin-left: -{{ $index * 4 }}px">
16+
<x-dynamic-component :component="'flag-' . $flag" class="w-6 h-6 rounded-full" />
17+
</div>
18+
@endif
19+
@endforeach
20+
21+
@if($remainingFlags > 0)
22+
<div class="relative" style="margin-left: -4px">
23+
<div class="w-6 h-6 flex items-center justify-center text-sm font-bold text-black rounded-full">
24+
+{{ $remainingFlags }}
25+
</div>
26+
</div>
27+
@endif
28+
</div>
29+
</x-filament-forms::field-wrapper>

packages/localization/src/Filament/Tables/Columns/TranslationColumn.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
class TranslationColumn extends TextColumn
1010
{
11+
protected string $view = 'localization::filament.tables.columns.translations';
12+
1113
protected function setUp(): void
1214
{
1315
parent::setUp();
14-
16+
1517
$this->label(__('localization::fields.language'))
1618
->sortable()
1719
->toggleable()
20+
->alignCenter()
1821
->searchable();
1922
}
2023
}

0 commit comments

Comments
 (0)