Skip to content

Commit

Permalink
Add formfield
Browse files Browse the repository at this point in the history
  • Loading branch information
emptynick committed May 30, 2020
1 parent d43c08c commit b1ebc74
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Tiptap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Route;
use Illuminate\View\View;
use Voyager\Admin\Contracts\Plugins\ThemePlugin;
use Voyager\Admin\Classes\Formfield;
use Voyager\Admin\Contracts\Plugins\FormfieldPlugin;

class Tiptap implements ThemePlugin
class Tiptap implements FormfieldPlugin
{
public $name = 'Tiptap';
public $description = 'Tiptap WYSIWYG editor for Voyager 2';
Expand Down Expand Up @@ -54,4 +55,9 @@ public function getJsRoutes(): array
route('voyager-tiptap')
];
}

public function getFormfield(): Formfield
{
return new TiptapFormfield();
}
}
28 changes: 28 additions & 0 deletions src/TiptapFormfield.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Emptynick\Tiptap;

use Voyager\Admin\Classes\Formfield;

class TiptapFormfield extends Formfield
{
public function type(): string
{
return 'tiptap';
}

public function name(): string
{
return 'Tiptap';
}

public function listOptions(): array
{
return [];
}

public function viewOptions(): array
{
return [];
}
}

0 comments on commit b1ebc74

Please sign in to comment.