Add Blog module to Citrus Platform: Created Blog resource with CRUD pages, schemas, and models. Implemented localization for English and Turkish, ensuring consistent user experience. Added migrations for blog categories, posts, and comments, including soft delete functionality. Enhanced table and form structures for better organization and usability.

This commit is contained in:
Ümit Tunç
2025-09-29 10:20:40 -03:00
parent a2087e7178
commit 79a1f5b746
20 changed files with 1145 additions and 70 deletions
@@ -21,10 +21,10 @@ class PageForm
->columns(3)
->schema([
// Sol kolon - Ana içerik (2 sütun genişliğinde)
Section::make('İçerik')
Section::make(__('pages.form_section_content'))
->schema([
TextInput::make('title')
->label('Başlık')
->label(__('pages.title_field'))
->required()
->maxLength(255)
->live(onBlur: true)
@@ -36,15 +36,15 @@ class PageForm
}),
TextInput::make('slug')
->label('URL Slug')
->label(__('pages.slug_field'))
->required()
->maxLength(255)
->unique(ignoreRecord: true)
->rules(['alpha_dash'])
->helperText('URL\'de görünecek kısım. Örnek: hakkimizda'),
->helperText(__('pages.slug_helper_text')),
RichEditor::make('content')
->label('İçerik')
->label(__('pages.content_field'))
->required()
->fileAttachmentsDisk('public')
->fileAttachmentsDirectory('pages')
@@ -52,20 +52,20 @@ class PageForm
->columnSpanFull(),
Textarea::make('excerpt')
->label('Özet')
->label(__('pages.excerpt_field'))
->rows(3)
->maxLength(500)
->helperText('Sayfa özeti (maksimum 500 karakter)')
->helperText(__('pages.excerpt_helper_text'))
->columnSpanFull(),
])
->columnSpan(2)
->collapsible(false),
// Sağ kolon - Metadata ve öne çıkan görsel (1 sütun genişliğinde)
Section::make('Sayfa Ayarları')
Section::make(__('pages.form_section_page_settings'))
->schema([
FileUpload::make('featured_image')
->label('Öne Çıkan Görsel')
->label(__('pages.featured_image_field'))
->image()
->disk('public')
->directory('pages/featured')
@@ -76,86 +76,86 @@ class PageForm
'4:3',
'1:1',
])
->helperText('Sayfa için öne çıkan görsel seçin')
->helperText(__('pages.featured_image_helper_text'))
->columnSpanFull(),
Select::make('author_id')
->label('Yazar')
->label(__('pages.author_field'))
->relationship('author', 'name')
->default(auth()->id())
->required()
->columnSpanFull(),
DateTimePicker::make('published_at')
->label('Yayın Tarihi')
->label(__('pages.published_at_field'))
->displayFormat('d.m.Y H:i')
->helperText('Boş bırakılırsa şu anki tarih kullanılır')
->helperText(__('pages.published_at_helper_text'))
->columnSpanFull(),
Select::make('status')
->label('Durum')
->label(__('pages.status_field'))
->options([
'draft' => 'Taslak',
'published' => 'Yayında',
'archived' => 'Arşivlendi',
'draft' => __('pages.status_draft'),
'published' => __('pages.status_published'),
'archived' => __('pages.status_archived'),
])
->default('draft')
->required()
->columnSpanFull(),
Select::make('parent_id')
->label('Üst Sayfa')
->label(__('pages.parent_field'))
->relationship('parent', 'title')
->searchable()
->preload()
->helperText('Bu sayfayı başka bir sayfanın alt sayfası yapmak için seçin')
->helperText(__('pages.parent_helper_text'))
->columnSpanFull(),
Select::make('template')
->label('Şablon')
->label(__('pages.template_field'))
->options([
'default' => 'Varsayılan',
'landing' => 'Landing Page',
'blog' => 'Blog',
'contact' => 'İletişim',
'default' => __('pages.template_default'),
'landing' => __('pages.template_landing'),
'blog' => __('pages.template_blog'),
'contact' => __('pages.template_contact'),
])
->default('default')
->columnSpanFull(),
TextInput::make('sort_order')
->label('Sıra')
->label(__('pages.sort_order_field'))
->numeric()
->default(0)
->helperText('Menüde görünme sırası')
->helperText(__('pages.sort_order_helper_text'))
->columnSpanFull(),
Checkbox::make('is_homepage')
->label('Ana Sayfa')
->helperText('Bu sayfayı ana sayfa olarak ayarla')
->label(__('pages.is_homepage_field'))
->helperText(__('pages.is_homepage_helper_text'))
->columnSpanFull(),
Checkbox::make('show_in_menu')
->label('Menüde Göster')
->label(__('pages.show_in_menu_field'))
->default(true)
->helperText('Bu sayfa menüde görünsün mü?')
->helperText(__('pages.show_in_menu_helper_text'))
->columnSpanFull(),
])
->columnSpan(1)
->collapsible(false),
// Alt kısım - SEO ayarları (tam genişlik)
Section::make('SEO Ayarları')
Section::make(__('pages.form_section_seo_settings'))
->schema([
TextInput::make('meta_title')
->label('Meta Başlık')
->label(__('pages.meta_title_field'))
->maxLength(60)
->helperText('Arama motorları için başlık (maksimum 60 karakter)'),
->helperText(__('pages.meta_title_helper_text')),
Textarea::make('meta_description')
->label('Meta Açıklama')
->label(__('pages.meta_description_field'))
->rows(3)
->maxLength(160)
->helperText('Arama motorları için açıklama (maksimum 160 karakter)')
->helperText(__('pages.meta_description_helper_text'))
->columnSpanFull(),
])
->columns(2)