Files
larablog/app/Filament/Resources/Attachments/AttachmentResource.php
T
goukiandCursor 64655ced1e
Build and Deploy / verify (push) Successful in 35s
Build and Deploy / deploy (push) Successful in 33s
feat: use xpier media library for uploads and markdown embeds
Store media:ID in article bodies instead of CDN URLs, and keep sablog attach tokens as a fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 19:03:52 +00:00

77 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Filament\Resources\Attachments;
use App\Filament\Resources\Attachments\Pages\CreateAttachment;
use App\Filament\Resources\Attachments\Pages\EditAttachment;
use App\Filament\Resources\Attachments\Pages\ListAttachments;
use App\Filament\Resources\Attachments\Schemas\AttachmentForm;
use App\Filament\Resources\Attachments\Tables\AttachmentsTable;
use App\Models\Attachment;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use App\Filament\Concerns\HasTranslatedLabels;
class AttachmentResource extends Resource
{
use HasTranslatedLabels;
protected static ?string $model = Attachment::class;
protected static function navKey(): string
{
return 'attachments';
}
public static function shouldRegisterNavigation(): bool
{
return false;
}
protected static function modelKey(): string
{
return 'attachment';
}
protected static function groupKey(): string
{
return 'content';
}
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
public static function form(Schema $schema): Schema
{
return AttachmentForm::configure($schema);
}
public static function table(Table $table): Table
{
return AttachmentsTable::configure($table);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => ListAttachments::route('/'),
'create' => CreateAttachment::route('/create'),
'edit' => EditAttachment::route('/{record}/edit'),
];
}
}