feat: use xpier media library for uploads and markdown embeds
Store media:ID in post bodies instead of CDN URLs, and keep sablog attach tokens as a fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,12 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Categories\Schemas;
|
||||
|
||||
use App\Support\MediaDisk;
|
||||
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Xpier\FilamentMediaLibrary\Components\MediaPicker;
|
||||
|
||||
class CategoryForm
|
||||
{
|
||||
@@ -43,12 +42,11 @@ class CategoryForm
|
||||
]),
|
||||
Section::make('封面')
|
||||
->schema([
|
||||
SpatieMediaLibraryFileUpload::make('cover')
|
||||
MediaPicker::make('cover_media_id')
|
||||
->label('封面图')
|
||||
->collection('cover')
|
||||
->image()
|
||||
->imageEditor()
|
||||
->disk(MediaDisk::name()),
|
||||
->module('articles')
|
||||
->mediaType('image')
|
||||
->relationship('coverMedia'),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user