PHP code example of bbs-lab / nova-toast-ui-editor-field
1. Go to this page and download the library: Download bbs-lab/nova-toast-ui-editor-field library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bbs-lab / nova-toast-ui-editor-field example snippets
namespace App\Nova;
use BBSLab\NovaToastUiEditorField\ToastUiEditor;
use Illuminate\Http\Request;
class BlogPost extends Resource
{
// ...
public function fields(Request $request)
{
return [
// ...
ToastUiEditor::make('Content'),
// ...
];
}
}
declare(strict_types=1);
namespace Workbench\App\Nova;
use BbsLab\NovaToastUiEditorField\Enums\ToastUiEditType;
use BbsLab\NovaToastUiEditorField\Enums\ToastUiLanguage;
use BbsLab\NovaToastUiEditorField\ToastUiEditor;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\FormData;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class Post extends Resource
{
public static $model = \Workbench\App\Models\Post::class;
public static $title = 'title';
public static $search = [
'id', 'title',
];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make('Title')
->sortable()
->rules('