Skip to content

Commit

Permalink
Merge pull request #149 from albertobenavides/3.x
Browse files Browse the repository at this point in the history
Update MarkdownEditor.php
  • Loading branch information
atmonshi authored Sep 12, 2023
2 parents 61c9903 + 010e520 commit 79b2f79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Editors/MarkdownEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
namespace LaraZeus\Sky\Editors;

use Filament\Forms\Components\Component;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Textarea;
use LaraZeus\Sky\Classes\ContentEditor;
use Spatie\FilamentMarkdownEditor\MarkdownEditor as MarkdownEditorAlias;

class MarkdownEditor implements ContentEditor
{
public static function component(): Component
{
if (class_exists(MarkdownEditorAlias::class)) {
return MarkdownEditorAlias::make('content')
if (class_exists(RichEditor::class)) {
return RichEditor::make('content')
->required();
}

Expand All @@ -21,7 +21,7 @@ public static function component(): Component

public static function render(string $content): string
{
if (class_exists(MarkdownEditorAlias::class)) {
if (class_exists(RichEditor::class)) {
return str($content)->markdown();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Filament/Resources/PostResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public static function form(Form $form): Form

$set('slug', Str::slug($state));
}),
SkyPlugin::get()->getEditor()::component(),
SkyPlugin::get()->getEditor()::component()
->label(__('Post Content')),
]),

Tabs\Tab::make(__('SEO'))->schema([
Expand Down

0 comments on commit 79b2f79

Please sign in to comment.