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
@@ -0,0 +1,73 @@
<?php
namespace App\Filament\Admin\Resources\Blogs;
use App\Filament\Admin\Resources\Blogs\Pages\CreateBlog;
use App\Filament\Admin\Resources\Blogs\Pages\EditBlog;
use App\Filament\Admin\Resources\Blogs\Pages\ListBlogs;
use App\Filament\Admin\Resources\Blogs\Schemas\BlogForm;
use App\Filament\Admin\Resources\Blogs\Tables\BlogsTable;
use App\Models\Blog;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class BlogResource extends Resource
{
protected static ?string $model = Blog::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText;
public static function getNavigationLabel(): string
{
return __('blog.navigation_label');
}
public static function getModelLabel(): string
{
return __('blog.model_label');
}
public static function getPluralModelLabel(): string
{
return __('blog.plural_model_label');
}
public static function form(Schema $schema): Schema
{
return BlogForm::configure($schema);
}
public static function table(Table $table): Table
{
return BlogsTable::configure($table);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => ListBlogs::route('/'),
'create' => CreateBlog::route('/create'),
'edit' => EditBlog::route('/{record}/edit'),
];
}
public static function getRecordRouteBindingEloquentQuery(): Builder
{
return parent::getRecordRouteBindingEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}