feat: add Partners and Bank Accounts pages via Pages module

This commit is contained in:
Muhammet Güler
2026-02-10 19:02:23 +03:00
parent b289cfd829
commit bda19b4b0f
6 changed files with 268 additions and 0 deletions
@@ -10,6 +10,8 @@ use App\Filament\Admin\Resources\Pages\Schemas\Sections\SectionTemplatesSection;
use App\Filament\Admin\Resources\Pages\Schemas\Sections\SeoSection; use App\Filament\Admin\Resources\Pages\Schemas\Sections\SeoSection;
use App\Filament\Admin\Resources\Pages\Schemas\Sections\TranslationsSection; use App\Filament\Admin\Resources\Pages\Schemas\Sections\TranslationsSection;
use App\Filament\Admin\Resources\Pages\Schemas\Sections\LogosSection; use App\Filament\Admin\Resources\Pages\Schemas\Sections\LogosSection;
use App\Filament\Admin\Resources\Pages\Schemas\Sections\PartnersSection;
use App\Filament\Admin\Resources\Pages\Schemas\Sections\BankAccountsSection;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
@@ -52,6 +54,8 @@ class PageForm
// Full Width - Logos (Only for Logolarımız template) // Full Width - Logos (Only for Logolarımız template)
LogosSection::make(), LogosSection::make(),
PartnersSection::make(),
BankAccountsSection::make(),
// Full Width - Translations // Full Width - Translations
TranslationsSection::make(), TranslationsSection::make(),
@@ -0,0 +1,69 @@
<?php
namespace App\Filament\Admin\Resources\Pages\Schemas\Sections;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Utilities\Get;
class BankAccountsSection
{
public static function make(): Section
{
return Section::make(__('Banka Hesapları'))
->description(__('Bu sayfada gösterilecek banka hesap bilgilerini buradan yönetebilirsiniz.'))
->schema([
Repeater::make('data.bank_accounts')
->label('Hesaplar')
->schema([
TextInput::make('bank_name')
->label('Banka Adı')
->placeholder('Örn: Ziraat Bankası')
->required(),
TextInput::make('branch_name')
->label('Şube Adı / Kodu')
->placeholder('Örn: Konak Şubesi / 1234'),
TextInput::make('account_holder')
->label('Hesap Sahibi')
->default('Trunçgil Teknoloji')
->required(),
TextInput::make('iban')
->label('IBAN')
->placeholder('TR00 0000 0000 0000 0000 0000 00')
->required(),
Select::make('currency')
->label('Para Birimi')
->options([
'TRY' => 'Türk Lirası (₺)',
'USD' => 'Amerikan Doları ($)',
'EUR' => 'Euro (€)',
'GBP' => 'Sterlin (£)',
])
->default('TRY')
->required(),
FileUpload::make('logo')
->label('Banka Logosu')
->image()
->disk('public')
->directory('banks')
->visibility('public'),
])
->grid(3)
->columnSpanFull()
->reorderableWithButtons()
->collapsible()
->cloneable(),
])
->visible(fn (Get $get): bool => $get('template') === 'corporate.bank-accounts')
->columnSpanFull()
->collapsible();
}
}
@@ -72,6 +72,8 @@ class PageSettingsSection
'home' => 'Home', 'home' => 'Home',
'corporate.testimonials' => 'Müşteri Görüşleri (Kurumsal)', 'corporate.testimonials' => 'Müşteri Görüşleri (Kurumsal)',
'corporate.logos' => 'Logolarımız (Kurumsal)', 'corporate.logos' => 'Logolarımız (Kurumsal)',
'corporate.partners' => 'Çözüm Ortaklarımız (Kurumsal)',
'corporate.bank-accounts' => 'Banka Bilgilerimiz (Kurumsal)',
]) ])
->default('default') ->default('default')
->columnSpanFull(), ->columnSpanFull(),
@@ -0,0 +1,46 @@
<?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([
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(),
])
->grid(4)
->columnSpanFull()
->reorderableWithButtons()
->collapsible()
->cloneable(),
])
->visible(fn (Get $get): bool => $get('template') === 'corporate.partners')
->columnSpanFull()
->collapsible();
}
}
@@ -0,0 +1,93 @@
@extends('layouts.site')
@section('content')
<section class="wrapper bg-light">
<div class="container pt-14 pb-14 xl:pt-20 xl:pb-20 lg:pt-20 lg:pb-20 md:pt-20 md:pb-20">
<div class="row text-center mb-10">
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<h1 class="display-1 mb-3">{!! $page->title !!}</h1>
@if($page->excerpt)
<p class="lead fs-lg mb-0">{!! $page->excerpt !!}</p>
@endif
</div>
</div>
<div class="row gy-6">
@php
$accounts = $page->data['bank_accounts'] ?? [];
@endphp
@forelse($accounts as $account)
<div class="col-md-6 col-lg-4">
<div class="card shadow-lg lift h-100 border-0 rounded-xl overflow-hidden group hover:shadow-2xl transition-all duration-300">
<div class="card-body p-8">
<div class="flex items-center justify-between mb-6">
@if(!empty($account['logo']))
<div class="bg-gray-50 flex items-center justify-center p-2 rounded-lg" style="width: 120px; height: 60px;">
<img src="{{ asset('storage/' . $account['logo']) }}" class="img-fluid" style="max-height: 100%; max-width: 100%;" alt="{{ $account['bank_name'] }}">
</div>
@else
<div class="bg-primary/10 text-primary w-16 h-16 rounded-lg flex items-center justify-center text-2xl">
<i class="uil uil-university"></i>
</div>
@endif
<span class="badge bg-pale-primary text-primary rounded-pill px-3 py-1 text-sm font-semibold">
{{ $account['currency'] ?? 'TRY' }}
</span>
</div>
<h3 class="h4 mb-1 text-dark group-hover:text-primary transition-colors">{{ $account['bank_name'] }}</h3>
@if(!empty($account['branch_name']))
<p class="text-muted text-sm mb-4">{{ $account['branch_name'] }}</p>
@else
<div class="mb-4"></div>
@endif
<div class="space-y-3">
<div>
<label class="text-xs uppercase text-gray-500 font-bold tracking-wider block mb-1">HESAP SAHİBİ</label>
<div class="text-dark font-medium">{{ $account['account_holder'] }}</div>
</div>
<div class="pt-2 border-t border-gray-100">
<label class="text-xs uppercase text-gray-500 font-bold tracking-wider block mb-1">IBAN</label>
<div class="font-mono text-lg text-primary font-bold tracking-tight break-all select-all selection:bg-primary/20 cursor-text">
{{ $account['iban'] }}
</div>
<button onclick="navigator.clipboard.writeText('{{ $account['iban'] }}'); alert('IBAN kopyalandı!');" class="text-xs text-primary mt-1 hover:underline flex items-center gap-1 cursor-pointer">
<i class="uil uil-copy"></i> Kopyala
</button>
</div>
</div>
</div>
<div class="h-1 w-full bg-gradient-to-r from-primary to-blue-500 transform scale-x-0 group-hover:scale-x-100 transition-transform duration-500 origin-left"></div>
</div>
</div>
@empty
<div class="col-12 text-center py-10">
<div class="bg-white p-10 rounded-xl shadow-sm border border-gray-100 inline-block">
<i class="uil uil-wallet text-6xl text-gray-300 mb-4 block"></i>
<h3 class="h4 text-gray-400">Henüz banka hesabı eklenmemiş.</h3>
<p class="text-gray-400">Yönetim panelinden banka hesaplarınızı ekleyebilirsiniz.</p>
</div>
</div>
@endforelse
</div>
@if($page->content)
<div class="row mt-14">
<div class="col-lg-10 mx-auto">
<div class="prose max-w-none text-center text-gray-600">
{!! $page->content !!}
</div>
</div>
</div>
@endif
</div>
</section>
@endsection
@@ -0,0 +1,54 @@
@extends('layouts.site')
@section('content')
<section class="wrapper !bg-[#ffffff] wrapper-border">
<div class="container pt-20 xl:pt-28 lg:pt-28 md:pt-28 pb-16 xl:pb-20 lg:pb-20 md:pb-20">
<h2 class="text-center !mb-8 text-3xl font-bold uppercase">{!! t('ÇÖZÜM ORTAKLARIMIZ') !!}</h2>
<div class="swiper-container clients !mb-0 relative z-10" data-margin="30" data-dots="false" data-loop="true" data-autoplay="true" data-autoplaytime="1" data-drag="false" data-speed="5000" data-items-xxl="7" data-items-xl="6" data-items-lg="5" data-items-md="4" data-items-xs="2">
<div class="swiper">
<div class="swiper-wrapper ticker">
@php
$partners = $page->data['partners'] ?? [];
@endphp
@foreach($partners as $partner)
@if(!empty($partner['logo']))
<div class="swiper-slide px-5">
@if(!empty($partner['url']))
<a href="{{ $partner['url'] }}" target="_blank" rel="nofollow" class="block">
@endif
<img class="!w-full !h-auto" src="{{ asset('storage/' . $partner['logo']) }}" alt="Partner">
@if(!empty($partner['url']))
</a>
@endif
</div>
@endif
@endforeach
{{-- Fallback for design preview if no data exists --}}
@if(empty($partners))
<div class="swiper-slide px-5"><img class="!w-full !h-auto" src="../../assets/img/brands/c1.png" alt="image"></div>
<div class="swiper-slide px-5"><img class="!w-full !h-auto" src="../../assets/img/brands/c2.png" alt="image"></div>
<div class="swiper-slide px-5"><img class="!w-full !h-auto" src="../../assets/img/brands/c3.png" alt="image"></div>
@endif
</div>
<!--/.swiper-wrapper -->
</div>
<!-- /.swiper -->
</div>
<!-- /.swiper-container -->
</div>
@if($page->content)
<div class="container pb-16 xl:pb-20 lg:pb-20 md:pb-20">
<div class="prose max-w-none">
{!! $page->content !!}
</div>
</div>
@endif
</section>
<!-- /section -->
@endsection