54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?php
|
||
|
||
namespace App\Filament\Admin\Resources\Pages\Schemas\Sections;
|
||
|
||
use Filament\Forms\Components\FileUpload;
|
||
use Filament\Forms\Components\Repeater;
|
||
use Filament\Forms\Components\TextInput;
|
||
use Filament\Schemas\Components\Section;
|
||
use Filament\Schemas\Components\Utilities\Get;
|
||
|
||
class PartnersSection
|
||
{
|
||
public static function make(): Section
|
||
{
|
||
return Section::make(__('Çözüm Ortakları'))
|
||
->description(__('Bu sayfada gösterilecek çözüm ortaklarını buradan yönetebilirsiniz.'))
|
||
->schema([
|
||
Repeater::make('data.partners')
|
||
->label('Partnerler')
|
||
->schema([
|
||
TextInput::make('name')
|
||
->label('Partner Adı')
|
||
->placeholder('Örn: Microsoft')
|
||
->maxLength(120)
|
||
->columnSpanFull(),
|
||
|
||
FileUpload::make('logo')
|
||
->label('Logo')
|
||
->image()
|
||
->disk('public')
|
||
->directory('partners')
|
||
->visibility('public')
|
||
->required()
|
||
->columnSpanFull(),
|
||
|
||
TextInput::make('url')
|
||
->label('Website URL')
|
||
->url()
|
||
->placeholder('https://example.com')
|
||
->columnSpanFull(),
|
||
])
|
||
->itemLabel(fn (array $state): ?string => $state['name'] ?? null)
|
||
->grid(4)
|
||
->columnSpanFull()
|
||
->reorderableWithButtons()
|
||
->collapsible()
|
||
->cloneable(),
|
||
])
|
||
->visible(fn (Get $get): bool => $get('template') === 'corporate.partners')
|
||
->columnSpanFull()
|
||
->collapsible();
|
||
}
|
||
}
|