Files
persegi/app/Filament/Resources/Posts/PostResource.php
T

41 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace App\Filament\Resources\Posts;
use App\Filament\Resources\Posts\Pages\CreatePost;
use App\Filament\Resources\Posts\Pages\EditPost;
use App\Filament\Resources\Posts\Pages\ListPosts;
use App\Filament\Resources\Posts\Schemas\PostForm;
use App\Filament\Resources\Posts\Tables\PostsTable;
use App\Models\Post;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
class PostResource extends Resource
{
protected static ?string $model = Post::class;
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-newspaper';
protected static string|\UnitEnum|null $navigationGroup = 'Konten';
protected static ?string $modelLabel = 'Artikel';
public static function form(Schema $form): Schema
{
return PostForm::configure($form);
}
public static function table(Table $table): Table
{
return PostsTable::configure($table);
}
public static function getPages(): array
{
return [
'index' => ListPosts::route('/'),
'create' => CreatePost::route('/create'),
'edit' => EditPost::route('/{record}/edit'),
];
}
}